Swashbuckle.AspNetCore v1.0.0 with OAuth2, flow : application -> IdentityServer4

前端 未结 1 643
一生所求
一生所求 2021-02-06 18:38

I can\'t seem to make my .net core web API work with swashbuckle, OAuth2 with an application flow. When I click the Authorize button, Fiddler shows that the call is OK and my lo

相关标签:
1条回答
  • 2021-02-06 19:14

    We have a very similar setup for a current project. Our rest api is secured with jwt bearer authentication and azure ad b2c. In this case there is no way swagger to pick up automatically the token.

    This solution works perfect for us: https://stackoverflow.com/a/39759152/536196

    services.AddSwaggerGen(c =>
    {
        c.OperationFilter<AuthorizationHeaderParameterOperationFilter>();
    });
    

    After that when you run your swagger UI, you should see an additional field for the token.

    0 讨论(0)
提交回复
热议问题