Redirect_uri how does it work?

Hi,

How does Keycloak know where to redirect after the user logged in.

If i try to access for example:

http://xxxx:xxxx/dashboard

then keycloak intercepts with its authentication mechanism and after i succesfully entered the user password, keycloak redirects to the /dashboard url.

But how or better where does Keycloak stores this url info.

I debugged the code from Keycloak and it generated such an url after the login mechanism :

https://xxxx:xxxx/redirect_uri?state=OABRtgrDMTcwaUtEyEBbv0lM3D8&session_state=65710cf8-b723-4e15-89cb-e5af4a0b2161&code=2463e1e9-dd25-409a-8d6e-d16160ed6ac3.65710cf8-b723-4e15-89cb-e5af4a0b2161.09b53d10-0fe4-4d7c-b902-bd3433852274

but how does Keyclaok then redirect to the proper context.

Thanks for any help