Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
We're using Active Directory for membership and in a Rest Extension when calling HttpContext.Current.User it is returning the currently logged in umbraco user rather than the currently logged in member..
I was wondering if anyone else had experienced this?
in a razor view using @Membership.GetUser().UserName it returns the logged in member
if I do this in code:
public class InductionHelper
[RestExtensionMethod(ReturnXml = false, AllowAll = true)]
public static string RegisterPolicyAgreement()
var memberName = Membership.GetUser().UserName;
var someRandomVarName = ApplicationContext.Current.Services.MemberService.GetByUsername(memberName);
Membership.GetUser() is querying based on the currently logged in umbraco admin user in our override of get user:
public class CustomMembershipProvider : ActiveDirectoryMembershipProvider
public override MembershipUser GetUser(string username, bool userIsOnline)
var result = (MembershipUser)HttpContext.Current.Session[username];
if (result == null)
result = base.GetUser(username, userIsOnline);
HttpContext.Current.Session[username] = result;
HttpContext.Current.Session["recentUser"] = username;
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted