3

I would like to authente users using an identity server on a Content Delivery.

Following Sitecore Documentation Configure a Sitecore instance and Sitecore Identity server I have :

  1. Patched the sc.variable identityServerAuthority to declare the Identity server URL on the CD. <sc.variable name="identityServerAuthority" value="https://my-identity-server.azurewebsites.net" />

  2. Added the connexion string on the CD <add name="sitecoreidentity.secret" connectionString="my-identity-server-secret" />

  3. Allowed the CD URL on the Identity Server <AllowedCorsOriginsGroup2>https://my-content-delivery.azurewebsites.net</AllowedCorsOriginsGroup2>

When I navigate to the CD, the site is displayed without redirecting to the Identity server first.

I don't understand why the CD doesn't call the Identity server.

Is there something wrong with my configuration/understanding?

  • 1
    I would assume you need to set security on your site to block anonymous access – Gatogordo Mar 6 at 9:49
1

I believe you'll need to do 2 things:

  1. Make sure the resource you're trying to access is not accessible without being authenticated
  2. Make sure you've got a login URL defined for your site

An example of point 2 you can find in Sitecore.Owin.Authentication.IdentityServer.config:

<sitecore>
  <sites>
    <site name="shell" set:loginPage="$(loginPath)shell/SitecoreIdentityServer" />
    <site name="admin" set:loginPage="$(loginPath)admin/SitecoreIdentityServer" />
  </sites>
</sitecore>
| improve this answer | |
1

Simply adding the configuration for identity server will not tell your CD website to enforce login. You can force login on your site by adding the requireLogin attribute to your site definition -

<site name="website">
        <patch:attribute name="rootPath">/sitecore/content/mysite</patch:attribute>
        <patch:attribute name="startItem">/home</patch:attribute>        
        <patch:attribute name="database">master</patch:attribute>
        <patch:attribute name="language">en</patch:attribute>        
        <patch:attribute name="requireLogin">true</patch:attribute>
        <patch:attribute name="loginPage">/yourloginpage</patch:attribute>
</site>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.