question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swashbuckle 5.0 and Password Grant Flow

See original GitHub issue

There is documentation on how to authenticate request with the Implicit Grant Flow but not with the Password Grant Flow. Based on the doc for the implicit grant I’ve enable swagger like this

Swashbuckle.Application.SwaggerEnabledConfiguration sec = config.EnableSwagger(c =>
      {
        c.SingleApiVersion("v1", "MyApi");

        c.OAuth2("oauth2")
          .Description("OAuth2 Password Grant")
          .Flow("password")
          .Scopes(scopes => { scopes.Add("read", "Read access to protected resources"); })
          .TokenUrl("http://localhost:51398/OAuth/token");
        c.OperationFilter<AssignOAuth2SecurityRequirements>();

        c.IncludeXmlComments(System.String.Format(@"{0}\bin\MyApi.XML", System.AppDomain.CurrentDomain.BaseDirectory));
      });

      sec.EnableSwaggerUi();

I took the “AssignOAuth2SecurityRequirements” extension under SwahsBuckle.Dummy.Core. Is there any other extensions needed for the Password Flow?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
pdusencommented, Dec 13, 2016

@domaindrivendev It looks like Password Flow support has landed in swagger-ui Master: https://github.com/swagger-api/swagger-ui/pull/2397

Are there any changes that need to be done in Swashbuckle to include this?

2reactions
pdusencommented, Jan 9, 2017

@domaindrivendev I’d appreciate a response to my comment above.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swashbuckle 5.0 and Password Grant Flow · Issue #202
There is documentation on how to authenticate request with the Implicit Grant Flow but not with the Password Grant Flow.
Read more >
OAuth2 with Resource Owner Password Credentials Grant
I'm trying to use Swashbuckle 5.0.x with OAuth2. I want to use OAuth2's Resource Owner Password Credentials Grant. I basically only want to...
Read more >
OAuth2 with Resource Owner Password Credentials Grant
I'm trying to use Swashbuckle 5.0.x with OAuth2. I want to use OAuth2's Resource Owner Password ... Enable Oauth2 client credentials flow in...
Read more >
Swagger UI (OpenApi) with Authorization code flow + ...
In this post I've tried to show how straightforward is to add Authorization code flow + PKCE in Swashbuckle Asp.Net Core. If you...
Read more >
How to do OAuth2 Authorization in ASP.NET Core ...
This post is about documenting OAuth 2 protected ASP.NET Core Web API using Swashbuckle. Last post - Securing Your Web API Using Azure ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found