跳过内容

Microsoft Entra ID

GitHub

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

  • The 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',
},
});
  • Replace 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 中实现详细信息 双因素身份验证 在双因素身份验证中实现详细信息