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

I gave the clientId and clientSecret but the request doesn't include Authorization header with Basic string #581

Closed
rakesh-sharma opened this issue Jul 26, 2018 · 1 comment

Comments

@rakesh-sharma
Copy link

rakesh-sharma commented Jul 26, 2018

I am using NbOAuth2AuthStrategy like below

       name: 'password',
        clientId :'xxxx',
        clientSecret: 'xxxx',
        baseEndpoint: 'https://www.xxx.com/',
	token: {
            grantType: NbOAuth2GrantType.PASSWORD,
            class: NbAuthOAuth2Token,
            endpoint: 'oauth/token'
        }

It should ideally send the Authorization header with Basic string generated using clientId and clientSecret, but it's not sending is there any way I can send this header?

Also the payload has parameter with name 'email' instead of that Can I name it 'username'

@alain-charles
Copy link
Contributor

You are right, it is a TODO in the NbOAuth2AuthStrategy.

According to https://tools.ietf.org/html/rfc6749#section-2.3 :

  • Clients in possession of a client password MAY use the HTTP Basic authentication scheme (...)
  • Alternatively, the authorization server MAY support including the
    client credentials in the request-body using the following
    parameters: client_id (...) and client_secret (...)

As a contributor to this strategy, i'll propose a PR that writes for the moment the first point, i.e. the basic authentication scheme.

@nnixaa what do you think ?

Alain

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

2 participants