Search code examples
ember-dataember-simple-auth

How to add authentication token as header in subsequent request in ember-simple-auth?


I am using simple-auth for authentication in my project. I am doing simple username/password authentication.

I have created custom authenticator which makes AJAX call to server which returns token.

My question is how do I add this token as request header in all subsequent request to server.

I am using RESTAdapter of ember-data for communicating with server.


Solution

  • You can simply implement and configure a custom authorizer as described in the README here: https://github.com/simplabs/ember-simple-auth#implementing-a-custom-authorizer