Update the Logo of a Custom Social Connection

Overview

This article explains how to update the logo for a custom social connection in Auth0. While the Auth0 Dashboard currently doesn’t provide a direct way to modify the logo, this can be achieved using the Auth0 Management API.

Applies To

  • Auth0 Custom Social Connections
  • Auth0 Management API

Solution

To update the icon logo of a custom social connection, use the Management API’s PATCH Connections by ID endpoint. This involves retrieving the existing connection configuration, modifying the icon_url property within the options object, and then sending the updated configuration back to Auth0.

Here’s a step-by-step guide:

Obtain the Management API Token:

  1. Log in to the Auth0 Dashboard.
  2. Navigate to Applications > APIs.
  3. Select the Auth0 Management API.
  4. Go to the API Explorer tab.
  5. Copy the API Token displayed there. This token will authorize the API request.

Get the Connection ID:

  1. In the Auth0 Dashboard, navigate to Authentication > Social.
  2. Select the custom social connection.
  3. Locate and copy the Identifier (this is the connection ID).

Prepare the API Request:

  1. To perform this operation, go to Update a connection endpoint
  2. The endpoint URL will be /api/v2/connections/:id, where: id is the connection ID that was copied earlier.
  3. The HTTP Method to use is PATCH.

Construct the Request Body:

  1. Before patching, it’s recommended to first retrieve the entire options object for the connection using the GET Connections by ID endpoint. This ensures that all existing settings are included and only modify the icon_url.
  2. In the PATCH request body, update the options object. Add or modify the icon_url property with the URL of the desired logo. For example:
{  "options": {
     "icon_url": "https://example.com/your-new-image.svg"
     // Include other existing options
   }
}

NOTE: Ensure the icon_url points to a publicly accessible image file (e.g., .svg, .png, .jpg).

Upon successful execution, the custom social connection’s logo will be updated to the new icon_url.