Add a custom icon to Auth0's Custom Social integrations
This is so fucking stupid.
There is no way to update the logo of a custom social connection on Auth0 without using the command line. On literally every other service I've used, there's a little box to upload a logo. But Okta have a funny idea of what developers want.
And, to make matters worse, their documentation contains an error! They don't listen to community requests or take bug reports, so I'm blogging in the hope that this is useful to you.
The Command
BASHcurl --request PATCH \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer eyJhb...ZEQ' \
--url 'https://whatever.eu.auth0.com/api/v2/connections/con_qwerty123456' \
--data ' ... '
You will also need to supply some JSON in the data
parameter. I've formatted it to be easier to read than the garbage documentation. All of these fields are mandatory.
JSON{
"options": {
"client_id": "your-app-id",
"client_secret": "Shhhhhh!",
"icon_url": "https://example.com/image.svg",
"scripts": {
"fetchUserProfile": "???"
},
"authorizationURL": "https://example.com/oauth2/authorize",
"tokenURL": "https://example.com/oauth2/token",
"scope": "auth"
},
"display_name": "Whatever"
}
OK, but how do you get all those values?
- Bearer token:
- Create a management token
- The only scope it needs is
update:connections
- URl
- This is your normal Auth0 domain name.
- The Connection ID at the end can be found in the dashboard of your social connection
- Client ID & Secret
- You set these in the social connection's dashboard.
-
icon_url
- Public link to an image. It can be an SVG.
-
fetchUserProfile
- Whatever code you want to run. If you don't want any, you can't leave it blank. So type in a couple of characters.
-
authorizationURL
andtokenURL
- Wherever you want to redirect users to
-
display_name
- What you want to show to the user
This is such a load of bollocks! Is it really that hard for the Okta team to put an input field with "type the URl of your logo"?