3

I am having issues using domain in Sitecore when pages are restricted to extranet\anonymous.

So my goal is to restrict extranet\anoymous from viewing a page(Test Page) then redirect me to my custom Login Page which requies login credentials.

This works when i am using domain="extranet" however, only extranet accounts can only be used for logging in.

The problem is, I need to be able to log in using my Sitecore account.

I have tried changing the domain to "sitecore'; however, if i do that, I can no longer be redirected to my Custom Login Page.

I would like to ask for advice/help. Thanks

  • To understand your problem, do you want your website users to have restricted access to some Sitecore pages or you want Sitecore users to not have access to few Sitecore items? Also, where are your Sitecore users - in Sitecore or from some AD integration? – Amit Gaurav Oct 4 '17 at 13:54
  • I want it to not be accessible to extranet users. Thus requiring website users to have restricted access ti Sitecore Pages. So basically, if website users access Sitecore pages, it will always redirect them to custom Login page. With that, Only sitecore credentials can be used for logging in. And Sitecore Users are coming from Sitecore itslef (user Manager). – ZQuiray Oct 4 '17 at 15:16
3

Separate Site Strategy

Given your clarifications, have you considered creating a separate site on which to host this protected content? In the site definition you can specify the security domain, and therefore limit it to Sitecore users/authors.

Quick Fix

Consider: extranet\anonymous is different from sitecore\anonymous Sitecore's user names are actually stored in ASP.NET Membership Services as fully-qualified names, including their domain. Sitecore simply looks at the supplied user name, and if it doesn't include the domain portion, prefixes the user name with the current Site's domain. (extranet by default on public sites)

Your login form should support allowing Sitecore users to enter their user name as "sitecore\myUserName" I have several clients that use this strategy currently, as it saves them from having discrete accounts to edit and read protected content.

Caveat Emptor

In order for this to work correctly, your sitecore\Everyone Role (or other more limited and appropriate role) needs the Read right to the Items you're protecting. If your content authors can currently edit the Items, you're all set, but if your reading Sitecore users are different from your editing Sitecore users, you'll have to make sure the permissions are set appropriately.

| improve this answer | |
  • It works adding the sitecore\myUserName. But if I would totally not let extranet accounts to login but only Sitecore ones, I would need to change the domain to domain="sitecore" in the site definition. This is to ensure that no extranet accounts can access my site. However, doing that, would no longer redirect the website user to my custom Login Page. I already put in the site definition as well the (loginPage="/Custom Login"). Where should I put the restriction so that any pages in the site would allow me to go the loginPage before accessing them? – ZQuiray Oct 5 '17 at 1:50
  • Assuming the site in question does have some public pages visible to extranet\anonymous, you should leave the site domain to extranet. To prevent extranet users from logging in, just make sure none are defined, and make sure that the page where your protected content starts has inheritance disabled for itself and child objects for the extranet\Everyone and extranet\Anonymous accounts. – Sergeant Sitecore Oct 5 '17 at 13:22
  • Since i need to login using Sitecore accounts and prevents the extranet users to see it, the site domain ="sitecore". To add, i added the requireLogin="true" and the loginPage="/Login" (the custom login page where user will be redirected). Then i set the security rights for the extranet users. – ZQuiray Mar 18 '19 at 10:28

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.