question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeycloakService.addTokenToHeader 7.3.0 regression

See original GitHub issue

Bug 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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mauriciovigolocommented, Jun 7, 2020

Hi @ermannob, thank you for reporting the issue. Version 7.3.1 is now released and includes the fix for this issue.

1reaction
jonkoopscommented, Jun 8, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found