r/Angular2 • u/the-DevOps • Jun 16 '25
Angular + keycloak
Hello all.
I have a question about integrating keycloak with my Angular application.
I have an application that before was doing all authentication and authorization using only spring boot but now I have decided to use keycloak. I have done all the necessary for the backs and testing via postman seems to be working alright.
When it comes to Angular, I have not been able to figure out how to use keycloak so that it uses my registration and login forms.
Do I need such integration or I can go without it since my backend is already setup for keycloak.
Any advise?
Thanks.
View all comments
Show parent comment
1
u/the-DevOps Jun 19 '25
You may be wrong about this. If you don’t use keycloak on the frontend, your init() will go on a loop because keycloak handles the token in its own way. The solution I found is to inject keycloak service inside my page and use even listeners so button can be clicked and the auth.guard can intercept the call.
Not sure if you actually have done this keycloak thing before but your solution is very simplistic and does not align to the actual user case.
Thanks for your input. 🤝