Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Tanver-Hasan/c078f884dde9e139eb7d7e65a99874aa to your computer and use it in GitHub Desktop.
Save Tanver-Hasan/c078f884dde9e139eb7d7e65a99874aa to your computer and use it in GitHub Desktop.
curl -X POST \
--url 'https://{YOUR TENANT NAME}.auth0.com/api/v2/connections' \
-H "Authorization: Bearer {Managment API access token}" \
-H "Content-Type: application/json" \
-d '{"name":"{connection name}","strategy":"samlp","options":{"metadataUrl":"{ IDP metadata url}"}}'
curl -X POST \
--url 'https://{YOUR TENANT NAME}.auth0.com/api/v2/connections' \
-H "Authorization: Bearer {Managment API access token}" \
-H "Content-Type: application/json" \
-d '{"name":"[CONECTION NAME]","strategy":"samlp","options":{"metadataUrl":"[Metadata URL]","fieldsMap":{"user_id":["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn","http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"]}}}''
@Tanver-Hasan
Copy link
Author

Tanver-Hasan commented Apr 25, 2019

Request Body

{
    "name": "[Connection name ]",
    "strategy": "samlp",
    "options": {
        "metadataUrl": "[Metadata URL]",
        "fieldsMap": {
            "user_id": [
                "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
                "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn",
                "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
            ]
        }
    }
}

https://auth0.com/docs/api/management/v2#!/Connections/post_connections

@Tanver-Hasan
Copy link
Author

Tanver-Hasan commented Apr 25, 2019

Mapping example :

{
 "user_id": [
   "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
   "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn",
   "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
 ],
 "email": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
 "name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
 "given_name": [
   "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname",
   "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
 ],
 "family_name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname",
 "groups": "http://schemas.xmlsoap.org/claims/Group"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment