KeycloakService.addTokenToHeader 7.3.0 regression
See original GitHub issueBug Report or Feature Request (mark with an x
)
- [ X] bug report
- [ ] feature request
Versions.
keycloak-angular 7.3.0 angualr 9.1.1 keycloak-js 9.0.2
Repro steps.
It seems there is a regression from version 7.2.0 to 7.3.0. The reproduction is straightforward, do a GET request using angular HttpClient expecting the bearer token to be added automatically.
The injection (and subsequently the request) fails.
The log given by the failure.
ERROR TypeError: You provided '() => Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
const token = yield this.getToken();
return headers.set(this._authorizationHeaderName, this._bearerPrefix + token);
})' where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
at subscribeTo (subscribeTo.js:27)
at from (from.js:9)
at KeycloakService.addTokenToHeader (keycloak-angular.js:244)
at KeycloakBearerInterceptor.handleRequestWithTokenHeader (keycloak-angular.js:289)
at MergeMapSubscriber.project (keycloak-angular.js:285)
at MergeMapSubscriber._tryNext (mergeMap.js:46)
at MergeMapSubscriber._next (mergeMap.js:36)
at MergeMapSubscriber.next (Subscriber.js:49)
at subscribeToPromise.js:5
at ZoneDelegate.invoke (zone-evergreen.js:364)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Keywords - keycloak-angular - npm
Easy Keycloak setup for Angular applications. Latest version: 12.1.0, last published: 17 days ago. Start using keycloak-angular in your ...
Read more >Keycloak: A real Scenario from Development to Production
Keycloak is a standalone authentication and authorization system based on Java and JBoss. Its powerful, comprehensive and amazing features ...
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
Hi @ermannob, thank you for reporting the issue. Version 7.3.1 is now released and includes the fix for this issue.
Sorry for breaking this guys, looks like I missed this method during my testing. @mauriciovigolo I’ll try to add some more tests as I refactor the code.