ASP.NET 5 OAuthBearerAuthentication: The following authentication scheme was not accepted: Bearer

前端 未结 1 1442
囚心锁ツ
囚心锁ツ 2020-12-05 11:55

Updated:

Pinpoint helped me get this prototype off the launch pad - I was very close except for:

  • I need to upgrade to the beta6 SDK as per these inst
相关标签:
1条回答
  • 2020-12-05 12:52

    You must register the OAuth2 bearer authentication middleware before MVC, or your users will be unauthenticated when reaching MVC:

    public class Startup {
        public void Configure(IApplicationBuilder app) {
            app.UseJwtBearerAuthentication(new JwtBearerOptions {
                // Your JWT bearer options.
            });
    
            app.UseMvc();
        }
    }
    
    0 讨论(0)
提交回复
热议问题