Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swashbuckle 5.0 and Password Grant Flow #202

Closed
remiplanglois opened this issue Feb 23, 2015 · 10 comments
Closed

Swashbuckle 5.0 and Password Grant Flow #202

remiplanglois opened this issue Feb 23, 2015 · 10 comments

Comments

@remiplanglois
Copy link

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?

@domaindrivendev
Copy link
Owner

As far as I can tell, the OAuth2 "Password flow" is not currently supported by the swagger-ui

swagger-api/swagger-ui#807

So, you can describe it in the spec (as you appear to be doing above) but you won't get any of the additional UI goodness. But, SB does allow you to a) inject your own JavaScript or b) inject your own version of index.html so if you were willing, you could theoretically build in the UI workflow yourself ...

@tjoudeh
Copy link

tjoudeh commented Jun 14, 2015

Hi @domaindrivendev is this still not available yet? I was hoping to be able to support this flow on the UI level too.

@rexthuhking
Copy link

@domaindrivendev I second the request by @tjoudeh this will be a much appreciated feature.

@ciscocabe
Copy link

I just develop my web api documentation using swashbuckle 5 but I think I will use another previous version because I need this feature.

@rifaj
Copy link

rifaj commented Aug 25, 2016

@domaindrivendev @tjoudeh Any update on this?

@pdusen
Copy link

pdusen commented Dec 13, 2016

@domaindrivendev It looks like Password Flow support has landed in swagger-ui Master: swagger-api/swagger-ui#2397

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

@pdusen
Copy link

pdusen commented Jan 9, 2017

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

@felschr
Copy link

felschr commented Jan 11, 2017

This would interest me, too.

@lookwhatisee
Copy link

I am also interested in the latest version of swagger ui. I believe the current version is 3.0.9 and seems to add additional support for the OAuth forms.

@simongymer
Copy link

simongymer commented Sep 6, 2019

Does anyone have some documentation on how to implement password flow in .NET Framework (rather than .NET Core).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants