mainmatter / ember-simple-auth

A library for implementing authentication/authorization in Ember.js applications.
https://ember-simple-auth.com
MIT License
1.93k stars 606 forks source link

Include client ID in Oauth2 Password Grant #2281

Open Matthijsy opened 3 years ago

Matthijsy commented 3 years ago

We are using ember-simple-auth for quite some time combined with doorkeeper for the authentication in our rails API. Now doorkeeper recently changed some things and now we are required to send an client_id when using the Resource Owner Password Grant.

We use the OAuth2PasswordGrantAuthenticator, but as far as I see we can only send the identification and the password. Is it possible to add the client id?

I hope I explained it well enough, please let me know if I have to clearify something

evangallup commented 3 years ago

This is an older question, but for anyone who stumbles across this through Google I felt like it's good to note here. Apparently this isn't documented anywhere (correct me if I'm wrong). I was able to find through the code that the client_id can be set in your authenticator, like this:

import OAuth2PasswordGrant from 'ember-simple-auth/authenticators/oauth2-password-grant';

export default OAuth2PasswordGrant.extend({
  serverTokenEndpoint: '<endpoint url>',
  clientId: '<client id>'
});