Skip to content

Microsoft Entra ID Device Code Login

Takashi Shinohara edited this page Aug 31, 2021 · 1 revision

Device Code Login is a method that allows users to authenticate via a web browser using a code provided by the application. This approach is required for users who have Multi-Factor Authentication (MFA) enabled.

  1. Start a PowerShell 7 prompt.

  2. Run the Connect-KshSite cmdlet.

Connect-KshSite -Url 'https://<tenantname>.sharepoint.com' -ClientId '<clientid>'
  1. When a warning message is displayed, start a web browser (Edge, Chrome, Firefox, etc.) and open the page.
WARNING: To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <devicecode> to authenticate.
  1. Enter the device code displayed in the warning message.

  2. Enter the username and click Next.

  3. Enter the password and click Sign in.

  4. If MFA is enabled, approve the request on your mobile device.

  5. Close the browser window.

Clone this wiki locally