Configure Static Upstream Query Parameters for Auth0 Federated Connections
Last Updated:
Overview
Update the connection options object via the Auth0 Management API to configure static upstream query parameters for Auth0 federated connections. Auth0 passes provider-specific query parameters to an upstream social or enterprise Identity Provider (IdP) during authentication. Auth0 automatically appends the specified query parameter to every authorization redirect that Auth0 sends to the upstream IdP for that connection.
Applies To
- Auth0
- Federated Connections
- Social Connections
- OAuth 2.0
- OpenID Connect (OIDC)
Solution
What is the process to configure static upstream query parameters for Auth0 connections?
Retrieve the current options object of the connection via the Auth0 Management API, merge the upstream_params object into the existing options, and send the complete merged options object in a PATCH request.
NOTE:
- The
PATCH /api/v2/connections/<id>endpoint overwrites the entire options object. Sending only the newupstream_paramsobject in the request body erases the existingclient_id,client_secret,scope, and other configuration settings of the connection. Always retrieve the full existing options object first and include all existing keys alongsideupstream_params. - Auth0 supports only valid OAuth 2.0 and OpenID Connect (OIDC) authorization parameters. Security Assertion Markup Language (SAML) connections do not support
upstream_params. Not all Identity Providers support upstream query parameters. Verify whether the target IdP supports the parameter before implementing.
The Connection Options Object Requires an Update via the Auth0 Management API
Retrieve the current connection configuration, merge the upstream parameters into the existing options object, and update the connection with the complete merged object.
NOTE: The following JSON payloads provide illustrative and testing examples only. Do not use these payloads in production as-is. Test the payloads thoroughly in a non-production environment before use.
- Call the Auth0 Management API Get a connection endpoint (
GET /api/v2/connections/<id>) and copy the entire existing options object from the response. Review the following example of an existing options object.{ "options": { "client_id": "<client_id>", "client_secret": "<client_secret>", "scope": ["openid", "profile", "email"] } }
NOTE: The Management API access token used for these calls requires the read:connections_options scope to return the options object in the Get a connection response and the update:connections scope to update the connection.
- Add the
upstream_paramskey to the options object from Step 1 while keeping every existing key and value intact. Review the following example demonstrating the addition of the upstream parameters key to the options object.{ "options": { "client_id": "<client_id>", "client_secret": "<client_secret>", "scope": ["openid", "profile", "email"], "upstream_params": { "prompt": { "value": "consent" } } } } - Call the Auth0 Management API Update a connection endpoint (
PATCH /api/v2/connections/<id>) with the full merged options payload from Step 2 in the request body.
Auth0 includes ?prompt=consent alongside standard OAuth 2.0 and OIDC parameters when redirecting the user to the authorization endpoint of the upstream IdP.