[Feature]: Add /oauth2/sign_up endpoint

Author: BastianCreated Sep 9, 2024Updated Sep 10, 2026
Labelsenhancement

Motivation

I'm using Keycloak with user registration and email verification enabled. For the oAuth2-proxy, I'm using the oidc provider and the skip_provider_button=true config option. On the landingpage of my application, I need/want two buttons:

  • A Create Account button that links to the Keycloak registration page
  • A Login button that links to the Keycloak login page

The login button is no problem: It can be a link to the /oauth2/sign_in endpoint, which first sets a CSRF cookie and then redirects to the Keycloak login page.

However, there is no corresponding /oauth2/sign_up endpoint for the registration button. Directly linking to the https://<keycloak-server>/auth/realms/<realm-id>/protocol/openid-connect/registrations address does work to create the account. However, when confirming the email address with the verification link received by mail, I end up on an oauth2-proxy error page complaining about a missing CSRF cookie.

Possible solution

Add a /oauth2/sign_up endpoint that first sets the CSRF cookie before redirecting to the registration page.

Provider

oidc

Source: oauth2-proxy/oauth2-proxy