Questions tagged [context-user]

Questions about Sitecore context user whether it is an anonymous and authenticated user, should use this tag

Filter by
Sorted by
Tagged with
0 votes
0 answers
55 views

Correct User Logged In, but Sitecore.Context.User Returns extranet\Anonymous and IsAuthenticated is False

I'm working with Sitecore 10 and encountering a peculiar issue with user authentication. On the Sitecore login page, the correct logged-in user's name is displayed in the top right corner, indicating ...
Owais Ahmed's user avatar
1 vote
2 answers
219 views

how can I run code on Sitecore on an event under a specific security account?

The events handlers in Sitecore run under default\anonymous (i.e. onpublish:end:remote). Can I run the code under Extranet\anonymous account?
stelios kaltsounis's user avatar
0 votes
1 answer
97 views

Sitecore.Context.IsLoggedIn always returns false with Areas

I have created an MVC area in the solution: Areas |_ CAG |_ Controllers |_ Models |_ Views When published, the Areas folder goes into the root of the instance's webroot. Here is the ...
sukesh's user avatar
  • 3,129
0 votes
1 answer
86 views

Code on German server parsing data correctly when run from admin page, but incorrectly when run as scheduled task

I posted this on https://stackoverflow.com/questions/70023408/aspose-worksheet-not-parsing-decimal-numbers-correctly-on-german-server-ignorin as well but figured I would frame it as a Sitecore ...
Erica Stockwell-Alpert's user avatar
2 votes
1 answer
652 views

Virtual User causing error with AntiForgeryToken, The provided anti-forgery token was meant for user "extranet\user", but the current user is ""

My site uses SSO for login so most site users do not have Sitecore accounts, as such when a user logs in a virtual user is created: protected void CreateVirtualUser(SSOCentralUser user) { ...
Erica Stockwell-Alpert's user avatar
5 votes
2 answers
794 views

Virtual user persisting Roles after logout

I am trying to login a virtual user for my application and have assigned roles to this virtual user. var virtualUser = Sitecore.Security.Authentication.AuthenticationManager.BuildVirtualUser(userName, ...
Shaurya's user avatar
  • 457
1 vote
1 answer
566 views

MVC custom controller Context.User is anonymous when authenticated

Any idea why Sitecore 9.3 would not pick up authenticated information of the user on a simple custom MVC controller method? I am trying to get the currently logged-in user, but it is showing Sitecore....
Jonathan Folland's user avatar