Get custom claims from a JWT using Owin

前端 未结 1 1723
感情败类
感情败类 2021-01-29 04:56

I\'m using Owin with JWTBearerAuthentication to authorize users and validate their tokens. I\'m doing it like this:

public class Startup
{
    public void Config         


        
相关标签:
1条回答
  • 2021-01-29 05:21

    Something like this might help:

    var identity = User.Identity as ClaimsIdentity;
    
            return identity.Claims.Select(c => new
            {
                Type = c.Type,
                Value = c.Value
            });
    
    0 讨论(0)
提交回复
热议问题