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

OAuth2 client_crendetials implementation doesn't follow the RFC #2183

Closed
aperinot-orange opened this issue May 30, 2016 · 1 comment
Closed
Assignees

Comments

@aperinot-orange
Copy link

aperinot-orange commented May 30, 2016

swagger-ui: master branch, commit aafca0f.

Oauth2's client_crendetials authentication mode is implemented as follows :

function clientCredentialsFlow(scopes, tokenUrl, OAuthSchemeKey) {
    var params = {
      'client_id': clientId,
      'client_secret': clientSecret,
      'scope': scopes.join(' '),
      'grant_type': 'client_credentials'
    }
    $.ajax(
    {
      url : tokenUrl,
      type: "POST",
      data: params,
      success:function(data, textStatus, jqXHR)
      {
        onOAuthComplete(data,OAuthSchemeKey);
      },
      error: function(jqXHR, textStatus, errorThrown)
      {
        onOAuthComplete("");
      }
    });

  }

By reading the corresponding paragraph in the RFC : https://tools.ietf.org/html/rfc6749#section-4.4.2

This is the kind of request that should be done :

POST /token HTTP/1.1
Host: server.example.com
Authorization: XXXXX
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials

It is impossible for now to use the "client_crendetials" authentication mode from Oauth2 in swagger with this implementation.

Maybe is there any workaround ?

@webron
Copy link
Contributor

webron commented Mar 24, 2017

This should be fixed.

@webron webron closed this as completed Mar 24, 2017
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

3 participants