So I am setting up ember-simple-auth
using the OAuth 2.0
extension. The issue is whenever I try to login and look at what's being sent as form data, it's only sending the grant_type
and password
parameter. However, the password
parameter is always empty, and sometimes it doesn't even show up. The username
parameter is always missing, I haven't seen it thus far.
Here is my login.hbs
code (btw I am using ember-cli)
<form {{action 'authenticate' on='submit'}}>
<label for="identification">Login</label>
{{input class="form-control" id='identification' placeholder='Enter Login' value=identification}}
<label for="password">Password</label>
{{input class="form-control" id='password' placeholder='Enter Password' type='password' value=password}}
<button type="submit">Login</button>
</form>
My login.js
code in controllers
import Ember from 'ember';
import LoginControllerMixin from 'simple-auth/mixins/login-controller-mixin';
export default Ember.Controller.extend(LoginControllerMixin, {
authenticator: 'simple-auth-authenticator:oauth2-password-grant'
});
My application.js
code in controllers
// app/routes/application.js
import Ember from 'ember';
import ApplicationRouteMixin from 'simple-auth/mixins/application-route-mixin';
export default Ember.Route.extend(ApplicationRouteMixin);
In my config/environment.js
file
if (environment === 'development') {
…
ENV['simple-auth-oauth2'] = {
serverTokenEndpoint: '/api/v1/oauth/token'
}
…
}
It's making the call to the right url after this change
In my initializers folder
// app/initializers/simple-auth-config.js
export default {
name: 'simple-auth-config',
before: 'simple-auth',
initialize: function() {
window.ENV = FrontENV;
}
};
It's pretty easy to notice that most of this code is copied from the tutorial on simplelabs
with some customizations. However, I can't figure out why the parameters aren't being sent correctly. Any help would be appreciated!