keyonic-v2
keyonic-v2 copied to clipboard
Integrating Keycloak in app
Hi everyone,
I have lost countless hours searching for a solution and this is my last chance to solve the problem. I cloned the repo and make it work properly very easily, connecting it to my realm in Keycloak. I have seen that this example makes the authentication page of Keycloak's realm load on app's start; I need to do the same thing, but only when the user wants to login in the app, so in a component that is loaded after.
Just to be clearer; the user opens the app and do whatever he wants; at a certain point, he needs to login to see some information. So he clicks on the button and at this point it should open the Keycloak view and check whether the credentials are correct or not, and just in case redirect him to a page.
I think the problem is with the keycloak.js loaded in index.html, that it's inizialized at first and then the KeycloakService is called before the App Component loading, but I can't figure how make it work.
I hope I was (enough) clear!
Thanks in advance,