跳过内容

Microsoft Entra ID

GitHub

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

  • 该 azure Auth Connect 预设
  • 直接 oauth2 配置 Microsoft 身份验证端点

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',
});
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 计划身份验证和帐户流程的 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 中的实现细节 双因素认证 在双因素认证中实现细节