How to handle uri redirect upon authentication with keycloak

1.2k Views Asked by At

I want to use keycloak for our Nodejs application authentication. We have a node.js backend and a UI5 frontend. I want all the traffic to flow through keycloak and then upon successful authentication the traffic should be redirected & allowed through and upon failure to redirect to a failure or permission denied screen.
How do you redirect requests to keycloak authentication and then redirect the traffic accordingly? I know keycloak has some keycloak.protect() to do authentication but how do you check the token and redirect traffic? How do you configure routes on backend and frontend w keycloak?

1

There are 1 best solutions below

0
On

In keycloak settings, you can find "redirect param" option there you can specify the redirect after authentication.