keycloak object properties such as keycloak.authenticated are not reactive
See original GitHub issueWhen I use e.g. keycloak.authenticated
(keycloak
gotten from the hook), things will not rerender even if authenticated
gets a new value. (as far as I can tell?)
I was thinking I could maybe solve this in my project by maybe sort of creating a useState
alternative for authenticated
, that somehow refreshes itself whenever the provider’s onEvent
callback runs. But I think this should probably be something that’s built into react-keycloak since it will be a common problem/usecase.
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Keycloak object property "authenticated" returns false when ...
However, once successfully logged in, I am being redirected to localhost:3000/welcome (which is good), but without any content (which is not ...
Read more >Securing Applications and Services Guide - Keycloak
The first is an application that asks the Keycloak server to authenticate a user for them. After a successful login, the application will...
Read more >Reactive Spring Security 5 Hands-On Workshop
It is fully non-blocking, supports Reactive Streams back pressure, ... Determines if an authenticated user has access to a specific object.
Read more >Fine-grained Authorization Services in Keycloak with Spring ...
As we know, Keycloak is the Identity and Access Management solution that provides out-of-the-box authentication and authorization services.
Read more >Spring Security 5 - OAuth2 Login - Baeldung
Learn how to authenticate users with Facebook, Google or other ... Adding these properties for at least one client will enable the ...
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
I’m glad I found this thread, I thought for sure that the hook would cause a re-render. React docs advise not to prevent re-renders especially when it comes to hooks since one of the strengths of React is that multiple re-renders can still produce a single update to the DOM.
Instead of changing the behaviour of a hook, an alternate hook could be provided with a different name.
PS. probably a good idea to mention in the readme that if people just want auth then they could probably use any OIDC compatible client