KeycloakService.addTokenToHeader needs to complete the observable
See original GitHub issueThe 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:
- Created 6 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top 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 >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 FreeTop 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
Top GitHub Comments
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.
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