ASP.NET 5 OAuth bearer token authentication

后端 未结 3 1990
有刺的猬
有刺的猬 2021-01-31 06:33

I’m trying to implement OAuth bearer token authentication in ASP.NET 5 and am struggling to find an example of how to do this because the OWIN stuff has changed in ASP.NET 5.

3条回答
  •  野的像风
    2021-01-31 06:57

    I am not sure where UseOAuthAuthorizationServer is, but for UseOAuthBearerAuthentication, try adding the Microsoft.AspNet.Security.OAuthBearer NuGet Package and then in your startup Configure Method add:

    app.UseOAuthBearerAuthentication(options =>
                {
                    options.Audience = {your audience};
                    options.Authority = {your authority}}); //or whatever options you need
    

提交回复
热议问题