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 -

python - ValueError: could not convert string to float -

php - Laravel Get all child node count with condition -