Get IPrincipal from OAuth Bearer Token in OWIN

前端 未结 4 1508
说谎
说谎 2020-11-29 22:04

I have successfully added OAuth to my WebAPI 2 project using OWIN. I receive tokens and can use them in the HTTP Header to access resources.

Now I want to use those

4条回答
  •  心在旅途
    2020-11-29 22:33

    What is your token like, is it an encrypt string or a formatted string, what is it format?

    I my code:

    public static Action receive = new Action(c =>
    {
            if (!string.IsNullOrEmpty(c.Token))
            {
    
                c.DeserializeTicket(c.Token);
                //c.OwinContext.Environment["Properties"] = c.Ticket.Properties;
            }
    });
    

    The c.Ticket is always null.

提交回复
热议问题