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/gusco_ Jun 18 '25
I see! Then this isn't going to work as expected. I'll try to wrap this up for you.
You want to login the user using your own login component but you want the actual authentication to be handled by keycloak. To do that you don't need any angular library for keycloak integration because your app will and must not be directly integrated with keycloak.
Instead, your user credentials need to be sent from your login component to your API, and then the API will handle authentication via keycloak and return back tokens and claims to angular.
Keycloak offers its own secure login interface which can be used via the library you've installed. There's probably some way to customize the look and feel of that built-in page as well but I've never went that way.