Zum Inhalt springen

GitHub

GitHub

GitHub wird durch den integrierten allgemeinen Anbieter unterstützt. oauth2 provider.

import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.initialize({
oauth2: {
github: {
appId: 'your-github-client-id',
authorizationBaseUrl: 'https://github.com/login/oauth/authorize',
accessTokenEndpoint: 'https://github.com/login/oauth/access_token',
redirectUrl: 'myapp://oauth/github',
scope: 'read:user user:email',
pkceEnabled: true,
resourceUrl: 'https://api.github.com/user',
},
},
});
const result = await SocialLogin.login({
provider: 'oauth2',
options: {
providerId: 'github',
},
});
console.log(result.result.accessToken?.token);
console.log(result.result.resourceData);

Wenn Sie __CAPGO_KEEP_0__ verwenden GitHub um die Authentifizierung und die Kontenflüsse zu planen, verbinden Sie es mit Mit @capgo/capacitor-social-login zur nativen Fähigkeit in Mit @capgo/capacitor-social-login, @capgo/capacitor-Social-Login zur Implementierungsdetail in @capgo/capacitor-social-login, @capgo/capacitor-Passwort zur Implementierungsdetail in @capgo/capacitor-passkey, @capgo/capacitor-native-biometrisch zur Implementierungsdetail in @capgo/capacitor-native-biometric, und Zwei-Faktor-Authentifizierung zur Implementierungsdetail in Zwei-Faktor-Authentifizierung.