We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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'm submitting a ... (check one with "x")
Current behavior: Properties added to the object that is sent to the token endpoint are modified to (apparently) include only email and password.
email
password
Expected behavior: Be able to include properties if desired by the user.
Steps to reproduce: Auth0 working command: curl --request POST --url 'https://myendpoint.auth0.com/oauth/token' --header 'content-type: application/json' --data '{"grant_type":"password","username": "<clientID>","password": "<password>", "scope": "openid", "client_id": "<clientID>"}'
curl --request POST --url 'https://myendpoint.auth0.com/oauth/token' --header 'content-type: application/json' --data '{"grant_type":"password","username": "<clientID>","password": "<password>", "scope": "openid", "client_id": "<clientID>"}'
Returns a fully working token. Note that clientSecret is not included and there is a field username instead of email.
clientSecret
username
Doing the same in Nebular using ngx-admin:
In core.module.ts:
core.module.ts
NbOAuth2AuthStrategy.setup({ name: 'myAuthStrategy', baseEndpoint: 'https://myendpoint.auth0.com', clientId: '<clientID>', clientSecret: 'none', // apparently necessary when using NbOAuth2ClientAuthMethod.REQUEST_BODY token: { endpoint: '/oauth/token', grantType: NbOAuth2GrantType.PASSWORD, class: NbAuthOAuth2Token }, clientAuthMethod: NbOAuth2ClientAuthMethod.REQUEST_BODY })
Custom login.component.ts (Copied from framework source and showing only the method login()):
login.component.ts
login()
login(): void { this.errors = this.messages = []; this.submitted = true; this.service.authenticate("myAuthStrategy", { username: '[email protected]', password: 'test' }).subscribe((result: NbAuthResult) => { this.submitted = false; if (result.isSuccess()) { this.messages = result.getMessages(); } else { this.errors = result.getErrors(); } const redirect = result.getRedirect(); if (redirect) { setTimeout(() => { return this.router.navigateByUrl(redirect); }, this.redirectDelay); } this.cd.detectChanges(); }); }
Looking in the developer console in chrome, the following reuqest body is sent:
Note that username is missing from the body. If the property username was changed to email, then the request holds the specified properties.
The text was updated successfully, but these errors were encountered:
@nnixaa i think @cloakedch is right. I had a closer look to the RFC here.
The request should have a usernameparameter and not an email parameter.
In NbOAuth2AuthStrategy, we build the request like this
const params = { grant_type: this.getOption('token.grantType'), email: email, password: password, };
email instead of username.
What do you think ? OK for a PR correcting this issue ?
Sorry, something went wrong.
@alain-charles
+1
3a708dd
No branches or pull requests
Issue type
I'm submitting a ... (check one with "x")
Issue description
Current behavior:
Properties added to the object that is sent to the token endpoint are modified to (apparently) include only
email
andpassword
.Expected behavior:
Be able to include properties if desired by the user.
Steps to reproduce:
Auth0 working command:
curl --request POST --url 'https://myendpoint.auth0.com/oauth/token' --header 'content-type: application/json' --data '{"grant_type":"password","username": "<clientID>","password": "<password>", "scope": "openid", "client_id": "<clientID>"}'
Returns a fully working token. Note that
clientSecret
is not included and there is a fieldusername
instead ofemail
.Doing the same in Nebular using ngx-admin:
In
core.module.ts
:Custom
login.component.ts
(Copied from framework source and showing only the methodlogin()
):Looking in the developer console in chrome, the following reuqest body is sent:
Note that
username
is missing from the body. If the propertyusername
was changed toemail
, then the request holds the specified properties.The text was updated successfully, but these errors were encountered: