Antti Simonen
Antti Simonen

Reputation: 974

ASP.NET Core ClaimsTransformation Windows Identity

I have an ASP.NET Core web app with Windows Authentication. I need some additional info behind the user and I thought using ClaimsTransformation would be a good idea. The idea works in other ways, but I don't seem to have access to the Windows Identity from the ClaimsTransformer. I need the Windows Identity name to resolve the additional info so any ideas how to achieve this?

When I look at the User object from the controller code, it has the Windows Identity (plus ClaimsIdentity), but in the ClaimsTransformer, I only have the ClaimsIdentity available.

Please also suggest better ways to add additional info for the user in some other way, if you think I'm looking at this the wrong way?

Upvotes: 0

Views: 568

Answers (1)

Antti Simonen
Antti Simonen

Reputation: 974

I found out that I can get the current Windows Identity by calling

WindowsIdentity.GetCurrent()

Now I only have other issues to resolve, but they are another story...

Upvotes: 1

Related Questions