Auth0
Kopiere einen Setup-Befehl mit den Installationsanweisungen und der vollständigen Markdown-Anleitung für diesen Plugin.
Übersicht
Abschnitt mit dem Titel „Übersicht“@capgo/capacitor-social-login unterstützt Auth0 auf zwei Arten:
SocialLoginAuthConnectmit demauth0Voreinstellung- Direkt
oauth2Konfiguration, wenn Sie die volle Kontrolle über Endpunkte haben möchten
Auth Connect-Voreinstellung-Beispiel
Beispiel für Auth Connect-Voreinstellungimport { 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',});Direktes OAuth2-Beispiel
Beispiel für Direktes OAuth2import { 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', },});