In Windows Identity Framework (WIF) you could implement a ClaimsAuthenticationManager
in order to modify the claims on the principal or add new claims to it.
The claims authentication manager provides an extensibility point in the application’s claims processing pipeline that you can use to validate, filter, modify, incoming claims or inject new claims into the set of claims presented by a ClaimsPrincipal before the RP application code is executed.
Does ASP.net Identity 2 have any sort of pipeline hook like this? If I want to add some claims without having them persisted in the AspNetUserClaims table how can I do this?
The logical place to do this would be right after the user has successfully signed in. This would occur in the
AccountController
login action:I use DI to inject
AuthenticationManager
intoAccountControllers
constructor and set it up as a property ofAccountController
. If you don't do this then you can just get it off theOWIN
context: