Richtlinie
Tutorial zum sozialen Login
Mit @capgo/capacitor-social-login soziale Anmeldungen durchführen
Alle sozialen Anmeldungen in einem Plugin für Web, iOS und Android. Es unterstützt Google, Apple, Facebook, Twitter/X und generische OAuth2/OIDC-Anbieter wie GitHub, Microsoft Entra ID, Auth0, Okta und Keycloak.
Installieren
npm install @capgo/capacitor-social-login
npx cap sync
Was dieses Plugin bereitstellt
initialize- Das Plugin initialisieren.login- Mit dem ausgewählten Anbieter anmelden.logout- Abmelden.isLoggedIn- Angemeldet ist.
Beispiel für die Verwendung
initialize
Initialisieren Sie das Plugin.
import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.initialize({} as InitializeOptions);
login
Mit dem ausgewählten Anbieter anmelden.
import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.login({} as Extract<LoginOptions, { provider: T }>);
logout
Abmelden.
import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.logout({} as {
provider: 'apple' | 'google' | 'facebook' | 'twitter' | 'oauth2';
providerId?: string;
});
isLoggedIn
Angemeldet ist.
import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.isLoggedIn({} as isLoggedInOptions);
Vollständige Referenz
- GitHub: https://github.com/Cap-go/capacitor-social-login/
- Dokumentation: /docs/plugins/social-login/
Weitermachen von Using @capgo/capacitor-social-login
If Sie __CAPGO_KEEP_0__ verwenden Mit @capgo/capacitor-social-login planen Sie die Authentifizierung und die Kontoflows, verbinden Sie es mit @capgo/capacitor-social-login um die Implementierungsdetails in @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-social-login zu erhalten @capgo/capacitor-social-login for the implementation detail in @capgo/capacitor-social-login, @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-passkey um die Implementierungsdetails in @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-passkey zu erhalten @capgo/capacitor-native-biometric um die Implementierungsdetails in @capgo/capacitor-native-biometric zu erhalten @capgo/capacitor-native-biometric for the implementation detail in @capgo/capacitor-native-biometric, and Zwei-Faktor-Authentifizierung für die Implementierungsdetails in der Zwei-Faktor-Authentifizierung.