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

Incorrect request_params for username-password login #109

Closed
mmaddex opened this issue Mar 27, 2018 · 4 comments
Closed

Incorrect request_params for username-password login #109

mmaddex opened this issue Mar 27, 2018 · 4 comments
Milestone

Comments

@mmaddex
Copy link

mmaddex commented Mar 27, 2018

This is preventing callers from passing audience and realm along.

There seem to be a few things that could be addressed here:

  • This should include audience and realm
  • Remove old /oauth/ro params: connection, id_token, and device
  • the default grant_type should be 'password' not password

request_params = {
client_id: @client_id,
client_secret: @client_secret,
username: username,
password: password,
scope: options.fetch(:scope, 'openid'),
connection: connection_name,
grant_type: options.fetch(:grant_type, password),
id_token: id_token,
device: options.fetch(:device, nil)
}
post('/oauth/token', request_params)

@gastonrey
Copy link

Am having problems to login via user/password due to the deprecated 'Connection' key, it's now realm, so I have changed the login method to:

request_params = { 
   client_id:     @client_id, 
   client_secret: @client_secret, 
   username:      username, 
   password:      password, 
   scope:            options.fetch(:scope, 'openid'), 
   realm:            connection_name, 
   grant_type:    options.fetch(:grant_type, 'password'), 
   id_token:      id_token, 
   device:        options.fetch(:device, nil) 
 } 

Replaced connection key by realm.

And then at my login request the grant-type is supposed to be passed as:

grant_type: 'http://auth0.com/oauth/grant-type/password-realm'

Just inside the options object. Would probably be a good idea to leave it as the default value when user/password login.

@joshcanhelp
Copy link
Contributor

Apologies for the late reply here ... the auth endpoints module in this SDK is getting an overhaul for the next release. We'll be deprecating (not removing yet) a few methods, this one included, and replacing with ones that more closely match how the endpoints work currently. All of the concerns here will be addressed.

Thank you for the report!

@j-collier
Copy link

We'll be deprecating (not removing yet) a few methods, this one included, and replacing with ones that more closely match how the endpoints work currently. All of the concerns here will be addressed.

Are the plans for this public? I'd love to help tackle this personally.

@joshcanhelp
Copy link
Contributor

joshcanhelp commented Oct 13, 2018

@j-collier - I appreciate the offer! The plans are not public but only because our tracking is done in the same system as our product. Happy to share what we have in mind remaining.

Much of this is complete, some of which has already been merged:

The remaining methods that have not been started:

  • A method to replace authorization_url ... current one works but could be structured better. It should also generate a state automatically. Replace with a method that does both and adds audience as a first-class parameter.
  • A method to use a refresh token to get a new access token (Cannot refresh access token with refresh token. #111).

If you want to take on one of those, I would be happy to guide and review! At the moment, we don't have a contribution guide (on my list to put one of those together soon) but a few notes:

If you want to take one or the other or both (separate PRs please), just let me know and I'll hold off on my end. I'll work on the contribution guide instead 😄

Thank you in advance!!

@joshcanhelp joshcanhelp added this to the v4.6.0 milestone Dec 17, 2018
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

4 participants