Zum Inhalt springen

Auth0

GitHub

@capgo/capacitor-social-login unterstützt Auth0 auf zwei Arten:

  • SocialLoginAuthConnect mit dem auth0 vordefinierten
  • Direkten oauth2 Konfiguration, wenn Sie die volle Kontrolle über Endpunkte haben

Beispiel für die Auth-Connect-Konfiguration

Beispiel für die Auth-Connect-Voreinstellung
import { SocialLoginAuthConnect } from '@capgo/capacitor-social-login';
await SocialLoginAuthConnect.initialize({
authConnect: {
auth0: {
domain: 'https://your-tenant.auth0.com',
clientId: 'your-auth0-client-id',
redirectUrl: 'myapp://oauth/auth0',
audience: 'https://your-api.example.com',
},
},
});
const result = await SocialLoginAuthConnect.login({
provider: 'auth0',
});
import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.initialize({
oauth2: {
auth0: {
appId: 'your-auth0-client-id',
authorizationBaseUrl: 'https://your-tenant.auth0.com/authorize',
accessTokenEndpoint: 'https://your-tenant.auth0.com/oauth/token',
redirectUrl: 'myapp://oauth/auth0',
scope: 'openid profile email offline_access',
pkceEnabled: true,
additionalParameters: {
audience: 'https://your-api.example.com',
},
logoutUrl: 'https://your-tenant.auth0.com/v2/logout',
},
},
});
const result = await SocialLogin.login({
provider: 'oauth2',
options: {
providerId: 'auth0',
},
});

Wenn Sie Auth0 verwenden Auth0 um Authentifizierung und Kontoflows zu planen, verbinden Sie es mit Mit @capgo/capacitor-Social-Login für die native Fähigkeit in Verwendung von @capgo/capacitor-Social-Login, @capgo/capacitor-Social-Login für die Implementierungsdetails in @capgo/capacitor-Social-Login, @capgo/capacitor-Passkey für die Implementierungsdetails in @capgo/capacitor-Passkey, @capgo/capacitor-Native-Biometrik für die Implementierungsdetails in @capgo/capacitor-Native-Biometrik und Zwei-Faktor-Authentifizierung für die Implementierungsdetails in Zwei-Faktor-Authentifizierung.