mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-15 19:52:01 +03:00
c8e8da4780
closes #2759 closes #3027 - added oauth2orize library for server side oAuth handling - added ember-simple-auth library for admin oAuth handling - added tables for client, accesstoken and refreshtoken - implemented RFC6749 4.3 Ressouce Owner Password Credentials Grant - updated api tests with oAuth - removed session, authentication is now token based Known issues: - Restore spam prevention #3128 - Signin after Signup #3125 - Signin validation #3125 **Attention** - oldClient doesn't work with this PR anymore, session authentication was removed
23 lines
777 B
JavaScript
23 lines
777 B
JavaScript
var AuthenticationInitializer = {
|
|
|
|
name: 'authentication',
|
|
after: 'registerTrailingLocationHistory',
|
|
|
|
initialize: function (container, application) {
|
|
Ember.SimpleAuth.Authenticators.OAuth2.reopen({
|
|
serverTokenEndpoint: '/ghost/api/v0.1/authentication/token',
|
|
refreshAccessTokens: true,
|
|
makeRequest: function (data) {
|
|
data.client_id = 'ghost-admin';
|
|
return this._super(data);
|
|
}
|
|
});
|
|
Ember.SimpleAuth.setup(container, application, {
|
|
authenticationRoute: 'signin',
|
|
routeAfterAuthentication: 'content',
|
|
authorizerFactory: 'ember-simple-auth-authorizer:oauth2-bearer'
|
|
});
|
|
}
|
|
};
|
|
|
|
export default AuthenticationInitializer; |