跳过内容

Microsoft Entra ID

GitHub

概述

概述

通过以下方式支持Microsoft Entra ID:

  • The azure Auth Connect预设
  • 直接 oauth2 对Microsoft身份端点进行配置

Auth Connect预设示例

标题:Auth Connect预设示例
import { SocialLoginAuthConnect } from '@capgo/capacitor-social-login';
await SocialLoginAuthConnect.initialize({
authConnect: {
azure: {
tenantId: 'common',
clientId: 'your-azure-client-id',
redirectUrl: 'myapp://oauth/azure',
},
},
});
const result = await SocialLoginAuthConnect.login({
provider: 'azure',
});

直接OAuth2示例

标题:直接OAuth2示例
import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.initialize({
oauth2: {
azure: {
appId: 'your-azure-client-id',
authorizationBaseUrl: 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize',
accessTokenEndpoint: 'https://login.microsoftonline.com/common/oauth2/v2.0/token',
redirectUrl: 'myapp://oauth/azure',
scope: 'openid profile email User.Read',
pkceEnabled: true,
resourceUrl: 'https://graph.microsoft.com/v1.0/me',
},
},
});
const result = await SocialLogin.login({
provider: 'oauth2',
options: {
providerId: 'azure',
},
});
  • 替换 common 将您的租户 ID 替换为单租户应用
  • resourceUrl 可以指向 Microsoft Graph 以及您在登录后立即获取用户资料

继续使用 Microsoft Entra ID

标题:继续使用 Microsoft Entra ID

如果您正在使用 Microsoft Entra ID 来规划身份验证和帐户流程,连接它与 使用@capgo/capacitor-social-login 为本地能力在使用@capgo/capacitor-social-login, @capgo/capacitor-social-login 为实现细节在@capgo/capacitor-social-login, @capgo/capacitor-passkey 为实现细节在@capgo/capacitor-passkey, @capgo/capacitor-native-biometric 为实现细节在@capgo/capacitor-native-biometric,以及 双因素身份验证 两因素认证的实现细节。