I have a project in WebAPI
in Net Framework Full
(it is not ASPNET Core
), with Swagger
already configured and I have already read numerous tutorials on the Internet, but nothing I did worked out. What I need is that Swagger
operations are already logged with token
, instead of displaying the following Authorization has been denied for this request.
message.
I have OAuth
set already generating token
and made changes in SwaggerConfig.cs
, but did not work.
follows what I thought:
c.OAuth2("oauth2")
.Description("OAuth2 Implicit Grant")
.Flow("application")
.AuthorizationUrl("https://meudominio/api/oauth2/authorize")
.TokenUrl("https://meudominio/api/oauth2/token");
in the end this file:
c.EnableOAuth2Support(
clientId: "CIH",
clientSecret: "CIH123",
realm: "test-realm",
appName: "Swagger UI"
//additionalQueryStringParams: new Dictionary<string, string>()
{
{ "foo", "bar" }
});
But nothing worked, how could you do that?