ASP.NET Core 2.0 JWT Validation fails with `Authorization failed for user: (null)` error

后端 未结 11 1489
暗喜
暗喜 2020-12-08 18:38

I\'m using ASP.NET Core 2.0 application (Web API) as a JWT issuer to generate a token consumable by a mobile app. Unfortunately, this token couldn\'t be validated by one con

11条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 18:58

    The sequence of the add statements in the configure function is of importance. Make sure that

    app.UseAuthentication();
    

    comes before

    app.UseMvc();
    

    Might this have been the problem?

提交回复
热议问题