> ## Documentation Index
> Fetch the complete documentation index at: https://docs-dev-fix-docs-5525.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Learn how to control login behavior with a social or enterprise identity provider by passing query parameters from your Auth0 application during the authorize request.

# Pass Parameters to Identity Providers

export const AuthCodeGroup = ({children, dropdown}) => {
  const [processedChildren, setProcessedChildren] = useState(children);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      unsubscribe = window.autorun(() => {
        const processChildren = node => {
          if (typeof node === "string") {
            let processedNode = node;
            for (const [key, value] of window.rootStore.variableStore.values.entries()) {
              const escapedKey = key.replaceAll(/[.*+?^${}()|[\]\\]/g, (String.raw)`\$&`);
              processedNode = processedNode.replaceAll(new RegExp(escapedKey, "g"), value);
            }
            return processedNode;
          } else if (Array.isArray(node)) {
            return node.map(processChildren);
          } else if (node && node.props && node.props.children) {
            return {
              ...node,
              props: {
                ...node.props,
                children: processChildren(node.props.children)
              }
            };
          }
          return node;
        };
        setProcessedChildren(processChildren(children));
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  return <CodeGroup dropdown={dropdown}>{processedChildren}</CodeGroup>;
};

export const AuthCodeBlock = ({filename, icon, language, highlight, children}) => {
  const [displayText, setDisplayText] = useState(children);
  const [copyText, setCopyText] = useState(children);
  const wrapperRef = React.useRef(null);
  useEffect(() => {
    let unsubscribe = null;
    function init() {
      if (!window.autorun || !window.rootStore) {
        return;
      }
      unsubscribe = window.autorun(() => {
        let processedChildrenForDisplay = children;
        let processedChildrenForCopy = children;
        for (const [key, value] of window.rootStore.variableStore.values.entries()) {
          const escapedKey = key.replaceAll(/[.*+?^${}()|[\]\\]/g, (String.raw)`\$&`);
          let displayValue = value;
          if (key === "{yourClientSecret}" && value !== "{yourClientSecret}") {
            displayValue = value.substring(0, 3) + "*****MASKED*****";
          }
          processedChildrenForDisplay = processedChildrenForDisplay.replaceAll(new RegExp(escapedKey, "g"), displayValue);
          processedChildrenForCopy = processedChildrenForCopy.replaceAll(new RegExp(escapedKey, "g"), value);
        }
        setDisplayText(processedChildrenForDisplay);
        setCopyText(processedChildrenForCopy);
      });
    }
    if (window.rootStore) {
      init();
    } else {
      window.addEventListener("adu:storeReady", init);
    }
    return () => {
      window.removeEventListener("adu:storeReady", init);
      unsubscribe?.();
    };
  }, [children]);
  useEffect(() => {
    if (!wrapperRef.current) return;
    const originalWriteText = navigator.clipboard.writeText.bind(navigator.clipboard);
    let isOverriding = false;
    const handleClick = e => {
      const button = e.target.closest('[data-testid="copy-code-button"]');
      if (!button || !wrapperRef.current.contains(button)) return;
      isOverriding = true;
      navigator.clipboard.writeText = text => {
        if (isOverriding) {
          isOverriding = false;
          navigator.clipboard.writeText = originalWriteText;
          return originalWriteText(copyText);
        }
        return originalWriteText(text);
      };
      setTimeout(() => {
        if (isOverriding) {
          isOverriding = false;
          navigator.clipboard.writeText = originalWriteText;
        }
      }, 100);
    };
    const wrapper = wrapperRef.current;
    wrapper.addEventListener('click', handleClick, true);
    return () => {
      wrapper.removeEventListener('click', handleClick, true);
      if (navigator.clipboard.writeText !== originalWriteText) {
        navigator.clipboard.writeText = originalWriteText;
      }
    };
  }, [copyText]);
  return <div ref={wrapperRef}>
      <CodeBlock filename={filename} icon={icon} language={language} lines highlight={highlight}>
        {displayText}
      </CodeBlock>
    </div>;
};

You can pass provider-specific parameters to an <Tooltip tip="Identity Provider (IdP): Service that stores and manages digital identities." cta="View Glossary" href="/docs/glossary?term=Identity+Provider">Identity Provider</Tooltip> (IdP) during authentication. The values can either be static per connection or dynamic per user.

## Limitations

For this configuration, be aware of the following restrictions:

* Only [valid OAuth 2.0/OIDC parameters](http://openid.net/specs/openid-connect-core-1_0.html#AuthorizationEndpoint) are accepted.
* Not all IdPs support upstream parameters. Check with the specific IdP before you proceed with your implementation.
* <Tooltip tip="Security Assertion Markup Language (SAML): Standardized protocol allowing two parties to exchange authentication information without a password." cta="View Glossary" href="/docs/glossary?term=SAML">SAML</Tooltip> IdPs do not support upstream parameters.

## Static parameters

Use static parameters to configure your connection to send a standard set of parameters to the IdP when a user logs in.

To configure static parameters, call the Auth0 <Tooltip tip="Management API: A product to allow customers to perform administrative tasks." cta="View Glossary" href="/docs/glossary?term=Management+API">Management API</Tooltip> [Create a connection](https://auth0.com/docs/api/management/v2/#!/Connections/post_connections) or [Update a connection](https://auth0.com/docs/api/management/v2/#!/Connections/patch_connections_by_id) endpoint, and pass the `upstream_params` object in the `options` object with the parameters you'd like to send to the IdP.

### Example: WordPress

WordPress allows you to pass an optional `blog` parameter to its <Tooltip tip="OAuth 2.0: Authorization framework that defines authorization protocols and workflows." cta="View Glossary" href="/docs/glossary?term=OAuth+2.0">OAuth 2.0</Tooltip> authorization endpoint, and automatically request access to a specified blog for users when they log in. To learn more, read [WordPress's OAuth 2.0 documentation](https://developer.wordpress.com/docs/oauth2/).

To follow this example, you'll need a working [WordPress Social connection](https://marketplace.auth0.com/integrations/wordpress-social-connection).

#### Get the connection

Call the Management API [Get a connection](https://auth0.com/docs/api/management/v2#!/Connections/get_connections_by_id) endpoint to retrieve the existing values of the `options` object:

<AuthCodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_WORDPRESS_CONNECTION_ID} \
    --header 'authorization: Bearer {YOUR_MANAGEMENT_API_TOKEN}' \
    --header 'content-type: application/json'
  ```

  ```csharp C# theme={null}
  var client = new RestClient("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_WORDPRESS_CONNECTION_ID}");
  var request = new RestRequest(Method.GET);
  request.AddHeader("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}");
  request.AddHeader("content-type", "application/json");
  IRestResponse response = client.Execute(request);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_WORDPRESS_CONNECTION_ID}"

  	req, _ := http.NewRequest("GET", url, nil)

  	req.Header.Add("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}")
  	req.Header.Add("content-type", "application/json")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```

  ```java Java theme={null}
  HttpResponse<String> response = Unirest.get("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_WORDPRESS_CONNECTION_ID}")
    .header("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}")
    .header("content-type", "application/json")
    .asString();
  ```

  ```javascript Node.JS theme={null}
  var axios = require("axios").default;

  var options = {
    method: 'GET',
    url: 'https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_WORDPRESS_CONNECTION_ID}',
    headers: {
      authorization: 'Bearer {YOUR_MANAGEMENT_API_TOKEN}',
      'content-type': 'application/json'
    }
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```php PHP theme={null}
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_WORDPRESS_CONNECTION_ID}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer {YOUR_MANAGEMENT_API_TOKEN}",
      "content-type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python theme={null}
  import http.client

  conn = http.client.HTTPSConnection("")

  headers = {
      'authorization': "Bearer {YOUR_MANAGEMENT_API_TOKEN}",
      'content-type': "application/json"
      }

  conn.request("GET", "/{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_WORDPRESS_CONNECTION_ID}", headers=headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_WORDPRESS_CONNECTION_ID}")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Get.new(url)
  request["authorization"] = 'Bearer {YOUR_MANAGEMENT_API_TOKEN}'
  request["content-type"] = 'application/json'

  response = http.request(request)
  puts response.read_body
  ```
</AuthCodeGroup>

The `options` object will look similar to:

```json lines theme={null}
{
  "options": {
    "client_id": "", 
    "profile": true, 
    "scope": ["profile"]
  }
}
```

#### Update the connection (static)

Copy the existing `options` object, and then add the `upstream_params` object with the `blog` field as an attribute:

```json lines theme={null}
{
  "options": {
    "client_id": "", 
    "profile": true, 
    "scope": ["profile"],
    "upstream_params": {
      "blog": {"value":"myblog.wordpress.com"}
    }
  }
}
```

Call the Management API [Update a connection](https://auth0.com/docs/api/management/v2/#!/Connections/patch_connections_by_id) endpoint with the `options` object in the body:

<AuthCodeGroup>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url 'https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/%7ByourWordpressConnectionId%7D' \
    --header 'authorization: Bearer {YOUR_MANAGEMENT_API_TOKEN}' \
    --header 'content-type: application/json' \
    --data '{"options":{"client_id":"","profile":true,"scope":["profile"],"upstream_params":{"blog":{"value":"myblog.wordpress.com"}}}}'
  ```

  ```csharp C# theme={null}
  var client = new RestClient("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/%7ByourWordpressConnectionId%7D");
  var request = new RestRequest(Method.PATCH);
  request.AddHeader("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}");
  request.AddHeader("content-type", "application/json");
  request.AddParameter("application/json", "{"options":{"client_id":"","profile":true,"scope":["profile"],"upstream_params":{"blog":{"value":"myblog.wordpress.com"}}}}", ParameterType.RequestBody);
  IRestResponse response = client.Execute(request);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"strings"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/%7ByourWordpressConnectionId%7D"

  	payload := strings.NewReader("{"options":{"client_id":"","profile":true,"scope":["profile"],"upstream_params":{"blog":{"value":"myblog.wordpress.com"}}}}")

  	req, _ := http.NewRequest("PATCH", url, payload)

  	req.Header.Add("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}")
  	req.Header.Add("content-type", "application/json")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```

  ```java Java theme={null}
  HttpResponse<String> response = Unirest.patch("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/%7ByourWordpressConnectionId%7D")
    .header("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}")
    .header("content-type", "application/json")
    .body("{"options":{"client_id":"","profile":true,"scope":["profile"],"upstream_params":{"blog":{"value":"myblog.wordpress.com"}}}}")
    .asString();
  ```

  ```javascript Node.JS theme={null}
  var axios = require("axios").default;

  var options = {
    method: 'PATCH',
    url: 'https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/%7ByourWordpressConnectionId%7D',
    headers: {
      authorization: 'Bearer {YOUR_MANAGEMENT_API_TOKEN}',
      'content-type': 'application/json'
    },
    data: {
      options: {
        client_id: '',
        profile: true,
        scope: ['profile'],
        upstream_params: {blog: {value: 'myblog.wordpress.com'}}
      }
    }
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```php PHP theme={null}
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/%7ByourWordpressConnectionId%7D",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "PATCH",
    CURLOPT_POSTFIELDS => "{"options":{"client_id":"","profile":true,"scope":["profile"],"upstream_params":{"blog":{"value":"myblog.wordpress.com"}}}}",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer {YOUR_MANAGEMENT_API_TOKEN}",
      "content-type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python theme={null}
  import http.client

  conn = http.client.HTTPSConnection("")

  payload = "{"options":{"client_id":"","profile":true,"scope":["profile"],"upstream_params":{"blog":{"value":"myblog.wordpress.com"}}}}"

  headers = {
      'authorization': "Bearer {YOUR_MANAGEMENT_API_TOKEN}",
      'content-type': "application/json"
      }

  conn.request("PATCH", "/{YOUR_AUTH0_DOMAIN}/api/v2/connections/%7ByourWordpressConnectionId%7D", payload, headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/%7ByourWordpressConnectionId%7D")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Patch.new(url)
  request["authorization"] = 'Bearer {YOUR_MANAGEMENT_API_TOKEN}'
  request["content-type"] = 'application/json'
  request.body = "{"options":{"client_id":"","profile":true,"scope":["profile"],"upstream_params":{"blog":{"value":"myblog.wordpress.com"}}}}"

  response = http.request(request)
  puts response.read_body
  ```
</AuthCodeGroup>

Now every time a user authenticates with this connection, the request to the Wordpress authorization endpoint will include the query parameter `blog=myblog.wordpress.com`.

## Dynamic parameters

Use dynamic parameters to configure your connection to send a set of parameters with values specific to the user to the IdP when they log in.

To configure dynamic parameters, call the Auth0 Management API [Create a connection](https://auth0.com/docs/api/management/v2/#!/Connections/post_connections) or [Update a connection](https://auth0.com/docs/api/management/v2/#!/Connections/patch_connections_by_id) endpoint, pass the `upstream_params` object in the `options` object with the parameters you'd like to send to the IdP, and specify the field that the parameter maps to with the `alias` attribute.

Here's a sample `options` object that we'll revisit later in the X example:

```json lines theme={null}
{
  "options": {
    "upstream_params": {
      "screen_name": {
        "alias": "login_hint"
      }
    }
  }
}
```

### Available fields

These are the available fields for the `alias` attribute:

* `acr_values`
* `audience`
* `client_id`
* `display`
* `id_token_hint`
* `login_hint`
* `max_age`
* `prompt`
* `resource`
* `response_mode`
* `response_type`
* `ui_locales`

### Example: X

X allows you to pass an optional `screen_name` parameter to its OAuth authorization endpoint. The `screen_name` parameter pre-fills the username input box of the login screen with the given value. To learn more, read [X's API reference](https://docs.x.com/fundamentals/authentication/api-reference#get-oauth%2Fauthorize).

To follow this example, you'll need a working [X Social connection](https://marketplace.auth0.com/integrations/twitter-social-connection).

#### Get the connection

Call the Management API [Get a connection](https://auth0.com/docs/api/management/v2#!/Connections/get_connections_by_id) endpoint to retrieve the existing values of the `options` object:

<AuthCodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}' \
    --header 'authorization: Bearer {YOUR_MANAGEMENT_API_TOKEN}' \
    --header 'content-type: application/json'
  ```

  ```csharp C# theme={null}
  var client = new RestClient("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}");
  var request = new RestRequest(Method.GET);
  request.AddHeader("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}");
  request.AddHeader("content-type", "application/json");
  IRestResponse response = client.Execute(request);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}"

  	req, _ := http.NewRequest("GET", url, nil)

  	req.Header.Add("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}")
  	req.Header.Add("content-type", "application/json")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```

  ```java Java theme={null}
  HttpResponse<String> response = Unirest.get("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}")
    .header("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}")
    .header("content-type", "application/json")
    .asString();
  ```

  ```javascript Node.JS theme={null}
  var axios = require("axios").default;

  var options = {
    method: 'GET',
    url: 'https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}',
    headers: {
      authorization: 'Bearer {YOUR_MANAGEMENT_API_TOKEN}',
      'content-type': 'application/json'
    }
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```php PHP theme={null}
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer {YOUR_MANAGEMENT_API_TOKEN}",
      "content-type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python theme={null}
  import http.client

  conn = http.client.HTTPSConnection("")

  headers = {
      'authorization': "Bearer {YOUR_MANAGEMENT_API_TOKEN}",
      'content-type': "application/json"
      }

  conn.request("GET", "/{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}", headers=headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Get.new(url)
  request["authorization"] = 'Bearer {YOUR_MANAGEMENT_API_TOKEN}'
  request["content-type"] = 'application/json'

  response = http.request(request)
  puts response.read_body
  ```
</AuthCodeGroup>

The `options` object will look something like this:

```text lines theme={null}
"options": {
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET",
  "profile": true
}
```

#### Update the connection (dynamic)

Copy the existing `options` object, add the `upstream_params` object with the `screen_name` field as an attribute, and then set the `alias` attribute to `login_hint`:

```json lines theme={null}
{
  "options": {
    "client_id": "", 
    "profile": true, 
    "scope": ["profile"],
    "upstream_params": {
      "screen_name": {
        "alias": "login_hint"
      }
    }
  }
}
```

Call the Management API [Update a connection](https://auth0.com/docs/api/management/v2/#!/Connections/patch_connections_by_id) endpoint with the `options` object in the body:

<AuthCodeGroup>
  ```bash cURL theme={null}
  curl --request PATCH \
    --url 'https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}' \
    --header 'authorization: Bearer {YOUR_MANAGEMENT_API_TOKEN}' \
    --header 'content-type: application/json' \
    --data '{"options": {"client_id": "{YOUR_CLIENT_ID}", "client_secret": "{YOUR_CLIENT_SECRET}", "profile": true, "upstream_params": {"screen_name": {"alias": "login_hint"}}}}'
  ```

  ```csharp C# theme={null}
  var client = new RestClient("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}");
  var request = new RestRequest(Method.PATCH);
  request.AddHeader("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}");
  request.AddHeader("content-type", "application/json");
  request.AddParameter("application/json", "{"options": {"client_id": "{YOUR_CLIENT_ID}", "client_secret": "{YOUR_CLIENT_SECRET}", "profile": true, "upstream_params": {"screen_name": {"alias": "login_hint"}}}}", ParameterType.RequestBody);
  IRestResponse response = client.Execute(request);
  ```

  ```go Go theme={null}
  package main

  import (
  	"fmt"
  	"strings"
  	"net/http"
  	"io/ioutil"
  )

  func main() {

  	url := "https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}"

  	payload := strings.NewReader("{"options": {"client_id": "{YOUR_CLIENT_ID}", "client_secret": "{YOUR_CLIENT_SECRET}", "profile": true, "upstream_params": {"screen_name": {"alias": "login_hint"}}}}")

  	req, _ := http.NewRequest("PATCH", url, payload)

  	req.Header.Add("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}")
  	req.Header.Add("content-type", "application/json")

  	res, _ := http.DefaultClient.Do(req)

  	defer res.Body.Close()
  	body, _ := ioutil.ReadAll(res.Body)

  	fmt.Println(res)
  	fmt.Println(string(body))

  }
  ```

  ```java Java theme={null}
  HttpResponse<String> response = Unirest.patch("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}")
    .header("authorization", "Bearer {YOUR_MANAGEMENT_API_TOKEN}")
    .header("content-type", "application/json")
    .body("{"options": {"client_id": "{YOUR_CLIENT_ID}", "client_secret": "{YOUR_CLIENT_SECRET}", "profile": true, "upstream_params": {"screen_name": {"alias": "login_hint"}}}}")
    .asString();
  ```

  ```javascript Node.JS theme={null}
  var axios = require("axios").default;

  var options = {
    method: 'PATCH',
    url: 'https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}',
    headers: {
      authorization: 'Bearer {YOUR_MANAGEMENT_API_TOKEN}',
      'content-type': 'application/json'
    },
    data: {
      options: {
        client_id: '{YOUR_CLIENT_ID}',
        client_secret: '{YOUR_CLIENT_SECRET}',
        profile: true,
        upstream_params: {screen_name: {alias: 'login_hint'}}
      }
    }
  };

  axios.request(options).then(function (response) {
    console.log(response.data);
  }).catch(function (error) {
    console.error(error);
  });
  ```

  ```php PHP theme={null}
  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "PATCH",
    CURLOPT_POSTFIELDS => "{"options": {"client_id": "{YOUR_CLIENT_ID}", "client_secret": "{YOUR_CLIENT_SECRET}", "profile": true, "upstream_params": {"screen_name": {"alias": "login_hint"}}}}",
    CURLOPT_HTTPHEADER => [
      "authorization: Bearer {YOUR_MANAGEMENT_API_TOKEN}",
      "content-type: application/json"
    ],
  ]);

  $response = curl_exec($curl);
  $err = curl_error($curl);

  curl_close($curl);

  if ($err) {
    echo "cURL Error #:" . $err;
  } else {
    echo $response;
  }
  ```

  ```python Python theme={null}
  import http.client

  conn = http.client.HTTPSConnection("")

  payload = "{"options": {"client_id": "{YOUR_CLIENT_ID}", "client_secret": "{YOUR_CLIENT_SECRET}", "profile": true, "upstream_params": {"screen_name": {"alias": "login_hint"}}}}"

  headers = {
      'authorization': "Bearer {YOUR_MANAGEMENT_API_TOKEN}",
      'content-type': "application/json"
      }

  conn.request("PATCH", "/{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}", payload, headers)

  res = conn.getresponse()
  data = res.read()

  print(data.decode("utf-8"))
  ```

  ```ruby Ruby theme={null}
  require 'uri'
  require 'net/http'
  require 'openssl'

  url = URI("https://{YOUR_AUTH0_DOMAIN}/api/v2/connections/{YOUR_X_CONNECTION_ID}")

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE

  request = Net::HTTP::Patch.new(url)
  request["authorization"] = 'Bearer {YOUR_MANAGEMENT_API_TOKEN}'
  request["content-type"] = 'application/json'
  request.body = "{"options": {"client_id": "{YOUR_CLIENT_ID}", "client_secret": "{YOUR_CLIENT_SECRET}", "profile": true, "upstream_params": {"screen_name": {"alias": "login_hint"}}}}"

  response = http.request(request)
  puts response.read_body
  ```
</AuthCodeGroup>

#### Call the login endpoint

When you call the Authentication API [Login endpoint](https://auth0.com/docs/api/authentication#login) for a user, you can pass their email address to the `login_hint` parameter:

export const codeExample41 = `https://{YOUR_AUTH0_DOMAIN}/authorize
  ?client_id={YOUR_CLIENT_ID}
  &response_type=token
  &redirect_uri={https://yourApp/callback}
  &scope=openid%20name%20email
  &login_hint=user@domain.com`;

<AuthCodeBlock children={codeExample41} language="bash" />

This value will then be passed to the X authorization endpoint as the `screen_name` parameter:

```text lines theme={null}
https://api.x.com/oauth/authorize
  ?oauth_token={yourXAuthToken}
  &screen_name=user@domain.com
```
