跳过内容

Microsoft Entra ID

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

  • The azure Auth Connect 预设
  • 直接 oauth2 配置 Microsoft 身份验证端点
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',
},
});
  • 用你的租户 ID 替换 common 用于单租户应用程序的租户 ID
  • resourceUrl 当您希望登录后立即获取用户资料时,可以指向 Microsoft Graph。

从 Microsoft Entra ID 中继续

标题:从 Microsoft Entra ID 中继续

如果您正在使用 Microsoft Entra ID 来规划身份验证和帐户流程,连接它到 使用 @capgo/capacitor-social-login 为 Using @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 的实现细节,和 双因素认证 对于双因素认证的实现细节