Zum Inhalt springen

Keycloak

GitHub

Keycloak funktioniert am besten über den integrierten oauth2 Anbieter mit OIDC-Entdeckung via issuerUrl.

OIDC-Entdeckungsbeispiel

Abschnitt: OIDC-Entdeckungsbeispiel
import { SocialLogin } from '@capgo/capacitor-social-login';
await SocialLogin.initialize({
oauth2: {
keycloak: {
issuerUrl: 'https://sso.example.com/realms/mobile',
clientId: 'mobile-app',
redirectUrl: 'myapp://oauth/keycloak',
scope: 'openid profile email offline_access',
pkceEnabled: true,
},
},
});
const result = await SocialLogin.login({
provider: 'oauth2',
options: {
providerId: 'keycloak',
},
});

Direkter Endpunkt-Beispiel

Abschnitt: Direkter Endpunkt-Beispiel
await SocialLogin.initialize({
oauth2: {
keycloak: {
appId: 'mobile-app',
authorizationBaseUrl: 'https://sso.example.com/realms/mobile/protocol/openid-connect/auth',
accessTokenEndpoint: 'https://sso.example.com/realms/mobile/protocol/openid-connect/token',
redirectUrl: 'myapp://oauth/keycloak',
scope: 'openid profile email offline_access',
pkceEnabled: true,
resourceUrl: 'https://sso.example.com/realms/mobile/protocol/openid-connect/userinfo',
logoutUrl: 'https://sso.example.com/realms/mobile/protocol/openid-connect/logout',
},
},
});

Weitermachen bei Keycloak

Abschnitt: Weitermachen bei Keycloak

Wenn Sie Keycloak für die Planung der Authentifizierung und der Kontoflows verwenden Using @capgo/capacitor-social-login Using @capgo/capacitor-social-login für die native Fähigkeit in Using @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-biometric für die Implementierungsdetails in @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-native-biometric, und das Zwei-Faktor-Authentifizierungsprotokoll für die Implementierungsdetails in der Zwei-Faktor-Authentifizierung.