Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

and NTLM in ASP.Net MVC

Tags:

asp.net-mvc

If I disable anonymous browsing of an MVC site and only allow NTLM authenticate users access, I presume any page simply decorated with the

[Authorize]

attribute will pass, so if I want to only allow user limited access to parts of the site, I'll need to do add them to an AD group and use that to apply the filter?

like image 471
Colin Desmond Avatar asked Jan 25 '26 22:01

Colin Desmond


1 Answers

[Authorize] by default will only look for IsAuthenticated flag. So yes, applying[Authorize] without additional param will allow all logged in users.

To limit, you can use Roles/Group (NOT OUs). It will check the IsInRole (from IPrincipal).

like image 199
Johannes Setiabudi Avatar answered Jan 28 '26 16:01

Johannes Setiabudi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!