providers/keycloak
KeycloakProfile
拡張
Record
<string
,any
>
プロパティ
acr
acr: string;
at_hash
at_hash: string;
aud
aud: string;
auth_time
auth_time: number;
azp
azp: string;
email: string;
email_verified
email_verified: boolean;
exp
exp: number;
family_name
family_name: string;
given_name
given_name: string;
iat
iat: number;
iss
iss: string;
jti
jti: string;
name
name: string;
picture
picture: string;
preferred_username
preferred_username: string;
session_state
session_state: string;
sid
sid: string;
sub
sub: string;
typ
typ: string;
user
user: any;
default()
default<P>(options): OAuthConfig<P>
Keycloakログインをページに追加します。
設定
コールバックURL
https://example.com/api/auth/callback/keycloak
設定
import { Auth } from "@auth/core"
import Keycloak from "@auth/core/providers/keycloak"
const request = new Request(origin)
const response = await Auth(request, {
providers: [
Keycloak({
clientId: KEYCLOAK_CLIENT_ID,
clientSecret: KEYCLOAK_CLIENT_SECRET,
issuer: KEYCLOAK_ISSUER,
}),
],
})
リソース
💡
「アクセス種別」を「Confidential」としてKeycloakにOpenID Connectクライアントを作成します。
発行者にはレルムを含める必要があります - 例: https://my-keycloak-domain.com/realms/My_Realm
備考
デフォルトでは、Auth.jsはKeycloakプロバイダーがOpen ID Connect仕様に基づいていると想定しています。
💡
Keycloakプロバイダーにはデフォルト設定が付属しています。ユースケースに合わせてデフォルトを上書きするには、ビルトインOAuthプロバイダーのカスタマイズをご覧ください。
型パラメーター
型パラメーター |
---|
P extends KeycloakProfile |
パラメーター
パラメーター | 型 |
---|---|
オプション | OAuthUserConfig <P > |
戻り値
OAuthConfig
<P
>