pysco68
pysco68

Reputation: 1146

ASP.NET Identity 2.0, self hosted OWIN, NTLM and application roles persistance

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:

What's working so far:

My 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.

Upvotes: 0

Views: 813

Answers (1)

pysco68
pysco68

Reputation: 1146

After a good amount of fiddling around the solutions is the following:

  1. Create a passive authentication middleware that does the NTLM authentication when asked to
  2. Create a custom action on the Accounts controller to transform the NTLM/Windows identity to an application identity and sign in with that one.

Upvotes: 1

Related Questions