|
この文書は自動機械翻訳技術を使用して翻訳されています。 正確な翻訳を提供するように努めておりますが、翻訳された内容の完全性、正確性、信頼性については一切保証いたしません。 相違がある場合は、元の英語版 英語 が優先され、正式なテキストとなります。 |
汎用 OIDC を設定する
汎用 OpenID Connect (OIDC) を使用すると、ユーザーは OIDC アイデンティティプロバイダー (IdP) にある既存のアカウントの資格情報を使用して Rancher にサインインできます。Rancher は OIDC プロトコルと SAML プロトコルとの統合をサポートしています。両方の実装は、Rancher で使用する際に機能的に同等です。以下の手順では、OIDC クライアントを作成し、Rancher を認証プロバイダーと連携させる方法を説明します。ユーザーは OIDC IdP のログインを使用して Rancher にサインインできます。
前提条件
アイデンティティプロバイダ
Rancher では、汎用 OIDC が無効になっています。
|
特定の IdP のドキュメントを参照して、リストされた前提条件を完了してください。 |
OIDC クライアント
IdP で、以下の設定を持つ新しいクライアントを作成します:
| 設定 | 値 |
|---|---|
|
|
|
|
|
|
|
|
|
|
新しい OIDC クライアントで、ユーザーのフィールドを公開するためにマッパーを作成します。
|
あなたのアイデンティティプロバイダーの OIDC クライアント内で作成したグループおよびグループパスマッパーによって生成された |
-
以下の設定を持つ新しい
Groups Mapperを作成します:設定 値 NameGroups MapperMapper TypeGroup MembershipToken Claim NamegroupsAdd to ID tokenOFFAdd to access tokenOFFAdd to user infoON -
以下の設定を持つ新しい
Client Audienceを作成します:設定 値 NameClient AudienceMapper TypeAudienceIncluded Client AudienceAdd to access tokenON -
以下の設定を持つ新しい
Groups Pathを作成してください。設定 値 NameGroup PathMapper TypeGroup MembershipToken Claim Namefull_group_pathFull group pathONAdd to user infoON
|
Rancher は "sub" クレームで受け取った値を使用して、Rancher 内の一意の識別子である PrincipalID を形成します。 これを一意で不変の値にすることが重要です。 |
Rancherでの汎用OIDCの設定
-
Rancher UIの左上隅で、*☰ > ユーザーと認証*をクリックします。
-
左のナビゲーションバーで、*認証プロバイダー*をクリックします。
-
*汎用 OIDC*を選択します。
-
*OIDCアカウントの設定*フォームに入力してください。フォームの記入に関するヘルプは、設定リファレンスを参照してください。
-
[*有効]*をクリックします。
RancherはIdPのログインページにリダイレクトします。RancherのKeycloak設定を検証するために、IdPの認証情報を入力してください。
IdPログインページを見るためにポップアップブロッカーを無効にする必要があるかもしれません。
*結果:*RancherはOIDCプロトコルを使用して、あなたのプロバイダーと連携するように設定されています。ユーザーはIdPのログインを使用してRancherにサインインできるようになりました。
カスタムクレームマッピング
汎用 OIDC 設定内でのカスタムクレームマッピングは、name、email、および groups のクレームに対応しています。これにより、IdPがトークン内で標準名を使用しない場合に、これらのOIDCクレームを手動でマッピングできます。
カスタムグループクレームの動作
カスタムグループクレームは、ユーザーグループの動作に影響を与えます:
-
ユーザーのトークンに標準OIDCの`groups`クレームとカスタムグループクレームの両方が存在する場合、カスタムクレームは標準クレームによって提供されるグループのリストを補完します。
-
トークンに標準のグループクレームが存在しない場合、カスタムクレームにリストされたグループがユーザーの唯一のグループを形成します。
|
カスタムクレームから取得したグループに対しては、検索機能は利用できません。これらのグループのいずれかに役割を割り当てるには、RBACフィールドにグループの正確な名前を手動で入力する必要があります。 |
構成リファレンス
| フィールド | 説明 |
|---|---|
クライアントID |
あなたのOIDCクライアントのクライアントID。 |
クライアントシークレット |
あなたのOIDCクライアントの生成されたシークレット。 |
秘密鍵/証明書 |
RancherとあなたのIdPの間に安全な接続を作成するための鍵/証明書ペアです。OIDCサーバーでHTTPS/SSLが有効になっている場合は必須です。 |
エンドポイント |
Rancher URL、Issue、およびAuth Endpointフィールドに生成された値を使用するか、誤っている場合は手動で上書きするかを選択してください。 |
Rancher URL |
あなたのRancherサーバーのURLです。 |
[発行者] |
あなたのIdPのURLです。 プロバイダーにディスカバリーが有効になっている場合、RancherはIssuer URLを使用して必要なすべてのURLを取得します。 |
認証エンドポイント |
ユーザーが認証するためにリダイレクトされるURLです。 |
PKCE拡張のためのOIDCサポート
Rancher supports the Proof Key for Code Exchange (PKCE) extension (RFC 7636) for OIDC authentication providers. SHA-256 (S256) is the only supported PKCE verification method. To enable this feature, your authentication provider must use PKCE with S256 for authorization requests.
You can enable this feature by selecting Enable PKCE (S256) in your authentication provider configuration in Rancher. Enabling S256 PKCE token verification allows you to mitigate authorization code interception attacks during OIDC authentication flows.
トラブルシューティング
OIDCサーバーへの接続をテストしている際に問題が発生した場合は、まずOIDCクライアントの設定オプションを再確認してください。Rancherのログを確認して、問題の原因を特定する手助けをすることもできます。デバッグログには、エラーに関するより詳細な情報が含まれている場合があります。このドキュメントのデバッグログを有効にする方法を参照してください。
すべての汎用 OIDC 関連のログエントリは、[generic oidc]`または[oidc]`で前置きされています。
認証プロバイダーにリダイレクトされません。
*Generic OIDCアカウントの設定*フォームに記入し、*有効にする*をクリックしてもIdPにリダイレクトされない場合は、OIDCクライアントの設定を確認してください。
OIDCシングルログアウト(SLO)の設定
Rancher supports the ability to configure OIDC Single Logout (SLO). Options include logging out of the Rancher application only, logging out of Rancher and registered applications tied to the external authentication provider, or a prompt asking the user to choose between the previous options.
Prerequisites
Before configuring OIDC SLO, ensure the following is set up on your IdP:
-
SLO Support: The Log Out behavior configuration section only appears if your OIDC IdP allows for
OIDC SLO. -
Post-Logout Redirect URI: Your Rancher Server URL must be configured as an authorized post-logout redirect URI in your IdP’s OIDC client settings. This URL is used by the IdP to redirect a user back to Rancher after a successful external logout.
OIDC SLO Configuration
Configure the SLO settings when setting up or editing your OIDC authentication provider.
-
Sign in to Rancher using a standard user or an administrator role.
-
In the top left corner, select ☰ > Users & Authentication.
-
In the left navigation menu, select Auth Provider.
-
Under the section Log Out behavior, choose the appropriate SLO setting as described below:
Setting Description Log out of Rancher and not authentication provider
Choosing this option will only logout the Rancher application and not external authentication providers.
Log out of Rancher and authentication provider (includes all other applications registered with authentication provider)
Choosing this option will logout Rancher and all external authentication providers along with any registered applications linked to the provider.
Allow the user to choose one of the above in an additional log out step
Choosing this option presents users with a choice of logout method as described above.
-
If you choose to log out of your IdP, provide an End Session Endpoint. Rancher uses this URL to initiate the external logout.
How to get the End Session Endpoint
The end_session_endpoint is one of the specific URLs published within a standardized JSON object containing the IdP’s metadata and is retrieved from the OIDC Discovery URL. To get the end_session_endpoint from the OIDC Discovery URL, follow these steps:
-
Obtain the Discovery URL by appending the IdP Issuer URL with the well-known path (
.well-known/openid-configuration). -
Send an HTTP
GETrequest to the Discovery URL. -
In the JSON object, look for the key named
end_session_endpointand retrieve the URL.You can also use a
curlcommand to retrieveend_session_endpoint:curl -s <ISSUER_URL>/.well-known/openid-configuration | jq '.end_session_endpoint'