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 needs to complete the observable

See original GitHub issue

The keycloak service creates an observable when calling KeycloakService.addTokenToHeader, but does not call observer.complete() to message the subscribers that it’s finished.

This changes the behavior of the angular httpClient methods (get, post, etc.)

As a workaround, we currently have to add a .take(1) (e.g. httpClient.get('protected/url')) to every http operation that is protected by keycloak. URLs that aren’t protected work as expected.

I would propose a fix by adding observer.complete(); after this line. https://github.com/mauriciovigolo/keycloak-angular/blob/266b7d9e104eabb57c45f17c461bd3109ea7c459/src/services/keycloak.service.ts#L328

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mauriciovigolocommented, Jan 28, 2018

Hello everyone!

Just released version v.1.2.3 with the bug fix. Thank you so much for opening the issue and for all your help @duydao, also @Herbis for confirming that the issue #5 was also related to this problem.

2reactions
mauriciovigolocommented, Jan 26, 2018

I’m really sorry @fennekit and everybody with the same issue. I will try to release today or in this weekend for sure. Was out this week on vacation and it was really hard to work on the library issues. On Monday the new version will be available. Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON Web Token - Detach token from particular request
I'm working on a multi-module Angular 7 project. I have injected an interceptor in the root ...
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 >
lbrkanic/keycloak-angular - UNPKG
r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License.
Read more >
What is Observable | Observables | Angular 12+ - YouTube
An observable is not native to angular or JavaScript. ... 50K views 9 months ago Complete Angular 13 Course Step by Step.
Read more >
RxJs Error Handling: Complete Practical Guide
The Observable Contract and Error Handling. In order to understand error handling in RxJs, we need to first understand that any given stream ......
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