QC20N
asked on
Trying to find user
I have moved my small homepage from Windows XP IIS to Windows 7 IIS.
I have this:
I did not have any problem to retrieve the user by using this: HttpContext.Current.User.I dentity.Na me
The content was for an exampel: AD\\DKSOKVK
"strPreWindows" I get from a DB
Now "HttpContext.Current.User. Identity.N ame" is empty.
First I thought it was because I didn't have Windows Authentication enabled, but it is enabled.
Can anyone help me?
I have this:
if (HttpContext.Current.User.Identity.Name.Contains(strPreWindows.TrimEnd()))
{
Do this
Do that
}
else
{
Response.Redirect("info.aspx?id=updatenotallowed", false);
}
I did not have any problem to retrieve the user by using this: HttpContext.Current.User.I
The content was for an exampel: AD\\DKSOKVK
"strPreWindows" I get from a DB
Now "HttpContext.Current.User.
First I thought it was because I didn't have Windows Authentication enabled, but it is enabled.
Can anyone help me?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you using a SQL db or Access db for your membership?
Check the aspnet_Applications table and the aspnet_membership table, we are looking for discrepancy with the ApplicationID field in aspnet_membership, they should all be the same as the ApplicationID in aspnet_Applications.
Had a similar issue some time ago, using Forms Authentication for some reason the app started reporting a new and different Membership.ApplicationName and subsequently, when a new user was created, a new ApplicationID. The new user able to login, but the existing users could not, because the combination of UserID and ApplicationID being passed by the membership provider, didn't match any UserID and ApplicationID combinations in the db.
I know you are using Windows Authentication, but wondering if the domain part of your login has changed "AD\\"; and is subsequently being interpreted as a different ApplicationID.
Try creating a new user, check the applicationID of the new membership user against the existing membership user record.
Alan
Check the aspnet_Applications table and the aspnet_membership table, we are looking for discrepancy with the ApplicationID field in aspnet_membership, they should all be the same as the ApplicationID in aspnet_Applications.
Had a similar issue some time ago, using Forms Authentication for some reason the app started reporting a new and different Membership.ApplicationName
I know you are using Windows Authentication, but wondering if the domain part of your login has changed "AD\\"; and is subsequently being interpreted as a different ApplicationID.
Try creating a new user, check the applicationID of the new membership user against the existing membership user record.
Alan
<authentication mode="Forms"/>
==>
<authentication mode="Windows"/>