Skip to content

Microsoft Entra ID Client Credential Login

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

Client Credential Login is a method that allows an application to authenticate to Microsoft Entra ID using a certificate. This authentication flow does not require user interaction and is typically used for background processes or service accounts that need to access SharePoint Online.

To use this method, you must register a Microsoft Entra ID application in your tenant and associate a certificate with the application. The certificate acts as the application's credential, enabling secure access to APIs. During app registration, you will obtain an Application ID and configure the necessary API permissions for your application.

Before you begin, please refer to Getting Started.

  1. Start a PowerShell 7 prompt.

  2. Run the Connect-KshSite cmdlet.

  • Windows

    Connect-KshSite -Url 'https://<tenantname>.sharepoint.com' -ClientId '<clientid>' -CertificatePath '<path>' -CertificatePassword (ConvertTo-SecureString -String '<password>' -AsPlainText -Force)
  • macOS or Linux

    Connect-KshSite -Url 'https://<tenantname>.sharepoint.com' -ClientId '<clientid>' -CertificatePath '<path>' -PrivateKeyPath '<path>'

Clone this wiki locally