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

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -