asp.net - httpContext User Identity -
i restrict user's access on website based on the user identity , used following code works fine in visual studio when publishing iis sending useridentity= null database.
dim httpcontext__1 httpcontext = httpcontext.current dim winidentity system.security.principal.windowsidentity = directcast(httpcontext__1.user.identity, windowsidentity) dim useridentity string = winidentity.name hasaccess = getuserfromdb(useridentity) if hasaccess ' restrictions on else end if
we need sure windows authentication enabled , anonymous authentication disabled.please see link
Comments
Post a Comment