authenticate(identification, password) {
return new RSVP.Promise(function(resolve, reject) {
Ember.$.ajax({
url: 'https://192.168.18.134/rest/auth',
type: 'GET',
headers: {
'Authorization': 'Basic ZW1iZXI6ZW1iZXI='
},
dataType: 'json'
}).then(function(responseObject/*, statusText, jqXHR*/) {
Ember.run(function() {
resolve(responseObject);
});
}, function(jqXHR/*, textStatus, errorThrown*/) {
Ember.run(function() {
reject(jqXHR);
});
});
});
},
ember generate authenticator oauth2
import OAuth2Bearer from 'ember-simple-auth/authorizers/oauth2-bearer';
export default OAuth2Bearer.extend();
export default OAuth2Bearer.extend({
authenticate(credentials) {
Ember.$.ajax(
'/rest/auth',
{
headers: {'Authorization': 'Basic ZW1iZXI6ZW1iZXI=' }
});
},
});
TypeError: undefined has no properties.
actions: {
auth() {
console.log(this.getProperties('login', 'password'));
}
}