dotnet / dotnet/AspNetCore.Docs
Windows Auth Documentation Missing Data on Generated Identity
- Dominant language
- C#
- Stars
- 13.1k
- Forks
- 24.6k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 97
Description
The Windows Authentication documentation does not provide any information on how to access/use data from a user that was authenticated by Windows - there is no information about what identity/claims/roles are populated by default.
For example, if we wanted to allow members of a Windows group to access a controller, [one user on StackOverflow](https://stackoverflow.com/questions/47986145/check-if-user-belongs-to-an-ad-group-net-core) claimed it should be possible to do:
```csharp
[Authorize(Roles = "NAME OF ACTIVE DIRECTORY GROUP")]
```
But this isn't documented - there's no information in the docs that a Windows user's groups are transferred to roles (another user answering that SO question wrote a custom middleware to map user identities to AD groups). Similarly, there's no information if the user's own identity is a valid role. For example, it's unclear if this is legal:
```csharp
[Authorize(Roles = "DOMAIN\USER")]
```
It would be great if the documentation could be expanded to provide more details on using the authenticated user's identity.
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: 401ad9a0-9e51-80a2-5846-82e9790d7257
* Version Independent ID: fbc36c26-9992-1f4c-66d3-02f898ee7ec4
* Content: [Configure Windows Authentication in ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-5.0&tabs=visual-studio#authorize-users)
* Content Source: [aspnetcore/security/authentication/windowsauth.md](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/authentication/windowsauth.md)
* Product: **aspnet-core**
* Technology: **aspnetcore-security**
* GitHub Login: @Rick-Anderson
* Microsoft Alias: **riande**
Contributor guide
Assessment
This issue has not been assessed yet.