Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set authorization header #326

Closed
SebLeich opened this issue Jan 15, 2018 · 2 comments
Closed

Set authorization header #326

SebLeich opened this issue Jan 15, 2018 · 2 comments

Comments

@SebLeich
Copy link

SebLeich commented Jan 15, 2018

is it possible to set the authorization header? I use a bearer token and the server needs the following header: "Authorization" "Bearer [token]"

Thank you!

@SebLeich SebLeich changed the title Set authentication header Set authorization header Jan 15, 2018
@morteza-gho
Copy link

In apihandler.js file, I add this:

$http.defaults.headers.common['Authorization'] = 'Bearer ' + token;

@durasj
Copy link
Contributor

durasj commented Jul 27, 2018

I can think of two ways to handle this.

You can either write a $http interceptor or add default headers as @morteza-gho pointed out, but rather in your code.

Or you can proxy the requests through some endpoint on the same domain so you could use cookies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants