1

I'm using asp.net core/OpenIdConnect/Cookies authentication.

I can add custom claims to the ClaimsIdentity in the TokenValidated event and these persist fine.

However there is an additional code path when I can only add the claims to the ClaimsIdentity as part of a Controller POST action. However these additional claims are not persisted and lost for the next request.

Is this actually possible to get these claims persisted - without forcing a login?

Thanks, Donal

Donal McWeeney
  • 241
  • 2
  • 14
  • Possible duplicate of this question: http://stackoverflow.com/questions/41870309/refresh-user-cookie-ticket-in-asp-net-core-identity Appears to be possible if you use the SignInManager.RefreshSignInAsync method. – kg743 May 15 '17 at 16:18
  • This response also might answer your question. Instead of changing the value in the controller, this person is doing it on each cookie validation. http://stackoverflow.com/questions/36073362/replace-value-in-cookie-asp-net-core-1-0 Let me know if neither of these articles answer your question, and I can investigate further. – kg743 May 15 '17 at 16:22
  • Thanks Kevin but we are not using ASP.Net Core Identity - using OpenIdConnect/Cookies and ADAL.I'll have to study the linked posts a bit more but I don't think they are applicable. – Donal McWeeney May 16 '17 at 11:40

0 Answers0