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

"password" and "application" flows are broken #3128

Closed
Naid405 opened this issue May 25, 2017 · 11 comments
Closed

"password" and "application" flows are broken #3128

Naid405 opened this issue May 25, 2017 · 11 comments
Assignees

Comments

@Naid405
Copy link

Naid405 commented May 25, 2017

When reporting an issue, please provide the following details:

  • swagger-ui version - 3.0.11
  • a swagger file reproducing the issue:
securityDefinitions: {
        OAuth2: {
            type: "oauth2",
            scopes: {
                "api": "API access"
            },
            flow: "application",
            tokenUrl: "/api/v3/oauth/token"
        }
    },
security: [{"OAuth2": []}]

According to spec at https://tools.ietf.org/html/rfc6749:
For "password" flow "username" and "password" should be passed in the body using the "application/x-www-form-urlencoded" and "client_id" and "client_password" should be passed via basic auth.
For "application" flow "client_id" and "client_password" should just be passed via basic auth.

Currently none of the options available for "password" flow provide the ability to authorize the way specification suggests since they don't actually send client credentials the way specification suggests.

Also maybe specification way should be the default one.

@Naid405
Copy link
Author

Naid405 commented May 30, 2017

Any progress on this?

@bodnia
Copy link
Contributor

bodnia commented May 30, 2017

@Naid405 I will provide you with more info asap

@bodnia bodnia closed this as completed in 5f2eaff May 31, 2017
bodnia added a commit that referenced this issue May 31, 2017
@bodnia
Copy link
Contributor

bodnia commented May 31, 2017

@Naid405 'application' flow is fixed, 'password' flow type 'body-parameter' changed. Fixes are in master

@Naid405
Copy link
Author

Naid405 commented May 31, 2017

Thank you, @bodnia.
Shouldn't 'body-parameter' be the default auth type? Since this is the 'type' specification suggests.

@bodnia
Copy link
Contributor

bodnia commented May 31, 2017

I think I can make it a default one. I'll notify you here once it's merged

bodnia added a commit to bodnia/swagger-ui that referenced this issue May 31, 2017
bodnia added a commit that referenced this issue May 31, 2017
 #3128 make request-body type default for aouth2 password flow
@bodnia
Copy link
Contributor

bodnia commented May 31, 2017

@Naid405 merged to master

@Naid405
Copy link
Author

Naid405 commented May 31, 2017

Thanks again!

@Naid405
Copy link
Author

Naid405 commented Jun 6, 2017

Hi, @bodnia. There's another bug with this now - if you just open the "Authorize" window, type username and password and hit the button it doesn't send the client credentials. Only after I select other type and select "Request Body" back it start sending client credentials.

@webron
Copy link
Contributor

webron commented Jun 6, 2017

@Naid405 can you please file a separate issue for that?

@Naid405
Copy link
Author

Naid405 commented Jun 6, 2017

@webron done: #3191

@frol
Copy link

frol commented Jun 10, 2017

Here is my thorough summary of the state of OAuth2 Password Flow implementation in Swagger-UI: #3227.

@lock lock bot locked and limited conversation to collaborators Jul 3, 2019
JuanSW18 pushed a commit to Digital-Paw/digital-paw-swagger-ui that referenced this issue Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants