I'm using Sitecore 9.1, thus an identity provider.
I have a custom domain named
aba and I'm logged in Sitecore Administration Console using an
Then I have this processor which is running on a custom site definition called
<site name="coveoapi" virtualFolder="/coveo" physicalFolder="/coveo" enableTracking="false" content="master" domain="sitecore" loginPage="/identity/login/shell/SitecoreIdentityServer"/>
During its execution, the
Sitecore.Context.Domain is always
sitecore no matter who is logged in.
Not only that, but the current user is always
I suspect that my identity provider is not resolving correctly users from
aba domain when the current site is
Anyone knows how to fix this?
Sitecore.Context.Domainis your site context domain, as specified in the very config you post a snippet of.
Sitecore.Context.User.Domainshould be what you're looking for. Also, be aware of which sites you authenticate to - which may or not be the same as the one you list here.
domainfor that site set to sitecore:
domain="sitecore". If you are logging into a different site in the site definitions, you will be anonymous in the
coveoapiand still when I access the instance using the instance name instead of a hostName (aka the site is resolved to
website) the same test gives my the logged user
aba\hsantos. That only leads me to think that I must authenticate on the resolved site for the current page, not really the site for the processor. Does that make sense?
sitecore\admin, so we can remove the domain from the possible causes. I'm tending towards something related to Identity provider can't resolve the current user for a given hostName.