1.1.0 doesn't add the authorisation bearer to the header
See original GitHub issueUpgraded from beta9
to 1.1.0
because #477 is fixed but, now something else seems to be broken.
I can’t see the authorisation Bearer
part anywhere in the header. I tried adding localhost
to the whitelist, but that didn’t help as well. Is something else changed?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:39 (7 by maintainers)
Top Results From Across the Web
Maven not adding "Authorization" header - Stack Overflow
I'm trying to deploy artifacts to a protected by Basic Auth repository. I specify <distributionManagement> <repository> <id> ...
Read more >HTTP error 401.1 with pre-authentication headers - Internet ...
An unexpected 401.1 status is returned when you use Pre-Authentication headers with Internet Explorer and Internet Information Services ...
Read more >Generating and using app-only Bearer Tokens | Docs
A bearer token allows developers to have a more secure point of entry for using the Twitter APIs, and are one of the...
Read more >OAuth 2.0 token endpoint - Connect2id
Authorisation code -- the code obtained from the authorisation endpoint which the server uses to look up the permission or consent given by...
Read more >WWW-Authenticate - HTTP - MDN Web Docs
The HTTP WWW-Authenticate response header defines the HTTP authentication methods ("challenges") that might be used to gain access to a ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seeing as how this library can sometimes be buggy, I decided to write my own HTTP_INTERCEPTOR, very easy, simply replace ‘rawJWT’ with the location of your JWT from local storage.:
Then in app.module.ts (note you have to import the above first as normal)
This library is great for decoding JWT’s but this is not the first time an update has broken the code, so with this easy code I can control how and where my JWT gets sent
Repeating from #481 - If you leave the whitelist empty the
isWhitelistedDomain
method will always return false. It will never match anything, and hence never send the authorization headers. (This is contrary to the documentation, which implies that having an empty whitelist will match local domain requests.) Furthermore, addinglocalhost
won’t work, because the domain for a domain-less request isnull
.Workaround - If you use domain-less routes, the workaround is to add the
null
domain to the whitelist, which you can do through a RegExp. In other words, do this:whitelistedDomains: [ /^null$/ ]