Redirect from external site to registration page

821 views
Skip to first unread message

david.a....@gmail.com

unread,
Dec 6, 2022, 8:53:15 AM12/6/22
to Keycloak User
Hi

Is it possible to redirect from an external site to the registration flow in keycloak?

On our company websites we want to add a 'Sign up' link which will redirect to the registration page on our Keycloak instance.
Sounds easy enough, we thought we could use the registration as per below, but its failing because we need to set the tab_id query parameter and don't know what it should be.

https://<host>/auth/realms/<realm>/login-actions/registration?client_id=<client-id>&tab_id=<we don't know what to set this to/>

Thanks in advance.
David Smith

Gustavo J Gallardo

unread,
Dec 27, 2022, 12:23:44 PM12/27/22
to david.a....@gmail.com, Keycloak User
Hi David,
if your Client is using OIDC authorization_code flow, the best way is to create a redirection almost identical to the "Login" link but using https://{hostname}/auth/realms/{realm}/protocol/openid-connect/registrations instead of the authorization_endpoint.

This way, the user will register and then return to your redirect_uri with the code, so the flow continues and the user ends up logged in to your app, with the newly registered user.

e.g.:
https://{hostname}/auth/realms/{realm}/protocol/openid-connect/registrations
?
client_id={my_client_id}
&
redirect_uri={my_rerdirect_uri}
&
response_type=code
&
scope=openid%20profile
&
state={some_state}



HTH,

Gustavo

--
You received this message because you are subscribed to the Google Groups "Keycloak User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keycloak-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/keycloak-user/d6be962a-9cfb-4dde-9043-6864d15623dcn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages