Question: Getting Authenticated User's Roles/Groups from Windows AD
Hi,
I'm using IdentityServer4 in my application using Windows Integrated authentication (Active Directory).
Quite new to using IdentityServer4. :) Does IdentityServer4 by default returns the authenticated user's AD Groups? Or, do I need to explicitly request that info?
Appreciate your inputs.
Thanks!
You would need to capture the Windows groups at login time - like here
https://github.com/IdentityServer/IdentityServer4.Quickstart.UI/blob/release/Quickstart/Account/AccountController.cs#L138
This would make them available to your profile service - which in turn can then put them into a token.
thanks for the response @leastprivilege. i do see the claims being added from the AccountController when I placed a breakpoint on code block below.

Tried enumerating the claims of the authenticated user from my MVC Web App (client) but i could not see the roles. So I guess i need to extend the IProfileService interface, is that right?
Also tried inspecting the claims inside in GetProfileDataAsync() method of my custom IUserProfileService i only see 5 claims.

Thanks in advance for your inputs :)
@leastprivilege i managed to retrieve the claims in my custom IProfileService. I added the role claims inside ExternalLoginCallback() action of the AccountController.

pls let me know your thoughts if its the correct way of doing it. :)
looks good.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.