0

Our current site (Sitecore 9.1) configuration looks like this: (simplified for readability)

<site name="the-website" patch:after="site[@name='modules_website']"
            language="en"
...                
            loginPage="/auth/login"
            requireLogin="true" />

We want to redirect unauthenticated users to an Access denied page. The Access denied page should exist in Sitecore, such that editors can configure its look-and-feel. If possible we would like to not configure Sitecore access rights.

Is it possible to use requireLogin for the entire site except for some specific pages?(like access denied)

This is for extranet users.

  • This is for extranet user? – Abhishek Malaviya May 22 at 14:19
  • Yes sorry for being unclear – Hos May 22 at 14:25
  • Hos I have rolled back your question to the original question posted. If you have further questions, they need to be opened separately, not appended on to the original, otherwise the answer that @MarkCassidy gave below doesn't make sense in the context of the question. If Marks answer, answers the question above, please accept it and open your extra questions as new posts. Thanks. – Richard Seal May 22 at 22:25
3

For this, you need to configure loginPage but set requireLogin to false.

Your next step will be to remove the access for Everyone on your /sitecore/content/site node and Remove Inheritance. You then need to create a new role, "Authenticated Users" which will get the access from this level down instead.

Finally you need to re-allow Everyone into the few pages you require. The error page and so on.

Brian Pedersen has a good writeup here: Sitecore: Login to website and how to restrict access to content

Your core problem is; if you set requireLogin to true like you suggest, Sitecore is always going to force a login. From anyone. Error pages or not.

  • Almost there. I updated the original question with some additional information. Now I am getting "Permission to the requested document was denied" – Hos May 22 at 19:03
  • Actually I am not sure if the information I added to the question, qualifies for a new question? If so, I will accept your comment as an answer. – Hos May 22 at 19:36
  • I didn't give a comment, I gave an answer. And polymorphic questions is a particularly nasty habit. Your amendment is a new question. – Mark Cassidy May 22 at 22:02

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.