Skip to content

Instantly share code, notes, and snippets.

@zamd
Last active January 26, 2019 01:05
Show Gist options
  • Save zamd/4aad51c1e3f852398c7637636ae75299 to your computer and use it in GitHub Desktop.
Save zamd/4aad51c1e3f852398c7637636ae75299 to your computer and use it in GitHub Desktop.
Selecting landing page via Auth0

Auth0 offers passing extra whitelisted params to upstream IdPs. This feature can be used to pass initial screen/page hint to the upstream IdP.

  • PATCH the custom oauth connection to whitelist and alias the upstream param
curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlFqVTVRVEpEUmpnd09UUXpOVGxFUlVZeFJURTRNams0TVRFMlFUUkVNVGxGTlRsRE5VWXlRUSJ9." -X PATCH  -H "Content-Type: application/json" -d '{"options":{"upstream_params":{"initial_page":{"alias":"login_hint"}}}}' "https://{domain}.auth0.com/api/v2/connections/{id}"
  • You can now pass intial page as standard login_hint value and auth0 would translate this to the configured outgoing parameter.
https://{domain}.auth0.com/authorize?client_id=wrRWXDvuC4DYqE3Di2qABhgORc8nPGPO&response_type=code&redirect_uri=http://requestbin.fullcontact.com/1i1ztdl1&connection=oidc_bridge&state=some-state&scope=openid profile&login_hint=aa_signup
  • Above would be redirected to:
https://{custom_oidc_server}/authorize?initial_page=bb_signup&response_type=code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment