I'm currently trying to get my hands on ASP.NET Identity 2.0 and there are some aspects I'm not finding answers to:
Here's my setup:
IdentityDbContext<>
What's working so far:
AuthenticationHandler<>
(I can access the User.Identity
in ApiControllersMy actual question
The claims I add to the identity aren't persisted to the database so they don't survive application restarts, nor are they correctly linked to the actual windows identity so two "sessions" of the same user can have different claims.
What I actually expected is that the ASP.NET Identity 2.0 creates some sort of "local (application) user" once I'm authenticated (from a successful NTLM handshake) where the application claims are stored.
I'm pretty sure there's some plumbing code missing somewhere, but I can't find where.
After a good amount of fiddling around the solutions is the following: