1. ユーザー認証

Sitecore Identity Server

Version:
日本語翻訳に関する免責事項

このページの翻訳はAIによって自動的に行われました。可能な限り正確な翻訳を心掛けていますが、原文と異なる表現や解釈が含まれる場合があります。正確で公式な情報については、必ず英語の原文をご参照ください。

Sitecore Identity (SI) は、Sitecore Content Hub™ にログインする 1 つの方法です。これにより独立した ID プロバイダーが提供され、Sitecore のサービスやアプリケーション全体でシングル サインオン (SSO) を設定できます。

Sitecore Identity Server フロー

SI は、この 2 つのコンポーネント間の対話を提供します。

  • Sitecore Identity Server - Open ID コネクト準拠のセキュリティ トークン サービス。
  • Sitecore Identity クライアント - SI Server からセキュリティ トークンを要求できる個別のアプリケーション。Sitecore インスタンス自体も SI クライアントです。

Sitecore Identity Server 認証

Sitecore 9.1 以降のすべての認証は、個別のスタンドアロン .NET Core アプリケーションによって処理されます。.NET Core アプリケーションは、IdentityServer4 フレームワークを基盤とし、OpenID を使用した SSO をサポートしています。

次のコード スニペットは、SSO を設定する方法の例です。

{
"$type": "Stylelabs.M.Portal.Authentication.SitecoreAuthenticationProviderConfigurator, Stylelabs.M.Portal",
"identity_server_url": "",
"client_id": "",
"client_secret": "",
"authentication_mode": "Passive",
"username_claim_type": "name",
"email_claim_type": "email",
"is_enabled": false
}
注意

この例では、username_claim_typeemail_claim_type を上書きします。Sitecore IdentityServer インスタンスでは、既定で名前とパスワードの標準クレーム タイプの代わりに名前E メールが使用されるためです。

次の表では、SI Server 認証のプロパティについて説明します。

プロパティ説明必須
identity_server_urlユーザーがサインイン プロセス中にリダイレクトされる IdentityServer インスタンスを指す必要があります。はい
client_idSitecore IdentityServer インスタンスによって認識されている OAuth クライアント ID。はい
client_secretSitecore IdentityServer インスタンスによって認識されている OAuth クライアント シークレット。はい
providerNameUI に表示される ID プロバイダーの名前。既定: Sitecoreいいえ (任意)
authenticationModeアクティブに設定されている場合、Web サイトはプロバイダーのログイン ページに自動的にリダイレクトされます。パッシブに設定されている場合、ユーザーはプロバイダーのログイン ページにリダイレクトされるように、[Sitecore 認証を使用する] ボタンをクリックする必要があります。既定: パッシブいいえ (任意)

Sitecore Identity Server の設定

Sitecore Identity Server を設定するには:

  1. Sitecore インスタンスと Sitecore Identity Server の設定」の手順に従ってください。

  2. OpenID Connect or OAuth 2.0 クライアントをモデル化するクライアント クラスを確認します。

  3. Sitecore.IdentityServer.Host.xml (IdentityServer\Config\production にある) を変更して、Sitecore インスタンスを設定します。

<?xml version="1.0" encoding="utf-8" ?>
<Settings>
<Sitecore>
<IdentityServer>
<CertificateThumbprint>E3626A03783CE066C88817D4086593CAFF906431</CertificateThumbprint>
<CertificateStoreLocation>LocalMachine</CertificateStoreLocation>
<CertificateStoreName>My</CertificateStoreName>
<SitecoreMembershipOptions>
<ConnectionString>Server=tcp:mdevsc-identity.database.windows.net,1433;Initial Catalog=sitecore-01-430890-core-db-dev;Persist Security Info=False;User ID=XXXXXXXX;Password=XXXXXXXXXXXXXXXXXXXXX;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;</ConnectionString>
</SitecoreMembershipOptions>
<AccountOptions>
<PasswordRecoveryUrl>http:\/sitecore/login?rc=1</PasswordRecoveryUrl>
</AccountOptions>
<Clients>
<DefaultClient>
<AllowedCorsOrigins>
<AllowedCorsOriginsGroup1>test.stylelabsdev.com</AllowedCorsOriginsGroup1>
</AllowedCorsOrigins>
</DefaultClient>
<PasswordClient>
<ClientSecrets>
<ClientSecret1>SIF-Default</ClientSecret1>
</ClientSecrets>
</PasswordClient>
<MClient>
<ClientId>m-client</ClientId>
<ClientName>mclient</ClientName>
<ClientSecrets>
<ClientSecret1>ClientSecret</ClientSecret1>
</ClientSecrets>
<RedirectUris>
<RedirectUri1>http://localhost:8080/</RedirectUri1>
<RedirectUri2>https://test.stylelabsdev.com/</RedirectUri2>
</RedirectUris>
<AllowedGrantTypes>
<AllowedGrantType1>authorization_code</AllowedGrantType1>

</AllowedGrantTypes>
<AllowedScopes>
<AllowedScope1>openid</AllowedScope1>
<AllowedScope2>sitecore.profile</AllowedScope2>
</AllowedScopes>
<AccessTokenType>0</AccessTokenType>
<AllowOfflineAccess>true</AllowOfflineAccess>
<AlwaysIncludeUserClaimsInIdToken>false</AlwaysIncludeUserClaimsInIdToken>
<AccessTokenLifetimeInSeconds>3600</AccessTokenLifetimeInSeconds>
<IdentityTokenLifetimeInSeconds>3600</IdentityTokenLifetimeInSeconds>
<AllowAccessTokensViaBrowser>true</AllowAccessTokensViaBrowser>
<RequireConsent>false</RequireConsent>
</MClient>
</Clients>
</IdentityServer>
<ExternalIdentityProviders>
<IdentityProviders>
<AzureAd>
<Enabled>false</Enabled>
</AzureAd>
</IdentityProviders>
</ExternalIdentityProviders>
</Sitecore>
</Settings>
この記事を改善するための提案がある場合は、 お知らせください!