Changing the icon from a Marketplace Social Connection

I want to change the icon for a connection from the marketplace, but I seem to get stuck.
The icon is the global brand icon, but I only want their regional icon.

Changing the display name was easy, but when submitting the options-object, I seem to have to attach a fetchUserScripts-list. When I GET the connection I do not get this property in return. So I am clueless as to what to set this parameter to, to be able to change the icon.

Any help would be appreciated

Hi @johanneskvamme

Welcome to the Auth0 Community!

Once you GET the connection details, even if the options parameter is not retrieved, you should still pe able to use it to update the connection itself.

Please try to UPDATE the connection and add the desired icon like this:

{
  "options": {
  "icon_url": "{{iconURL}}"
  }
}

Please keep in mind that depending on the connection, you might be required to add additional parameters when updating it, you can retrieve the necessary information from the GET request you have previously performed.

If you have any other questions or if you still experience issues, let me know!

Kind Regards

Thank you, both for the welcome and the reply, Nik!

When I GET the connection, the response does not have any “scripts” field.

{
“name”: “vipps-mobilepay-social-connection”,
“realms”: \[
“vipps-mobilepay-social-connection”
\],
“strategy”: “oauth2”,
“enabled_clients”: \[
“REDACTED”,
“REDACTED”
\],
“display_name”: “Vipps”,
“is_domain_connection”: false,
“id”: “REDACTED”
}

Yet when I try to UPDATE the connection, I get a 400 Bad Request stating {“statusCode”:400,“error”:“Bad Request”,“message”:“Payload validation error: ‘Missing required property: scripts’ on property options.”,“errorCode”:“invalid_body”}

I have to admit that I have no idea what this scripts-property should contain, since the GET does not return any data for it.

Hi again!

Have you performed the GET connection using the Management API page I have linked above? I was

I have created a dummy connection for Vipps Mobilepay and when I run it I received the scripts and also the icon_url as seen below:

"scripts": {
      "fetchUserProfile": "function fetchUserProfile(accessToken, context, callback) {\n  request.get(\n    {\n      url: \"https://api.vipps.no/vipps-userinfo-api/userinfo\",\n      headers: {\n        Authorization: `Bearer 🔒"
    },
    "icon_url": "https://cdn.auth0.com/marketplace/catalog/content/assets/social-connections/vipps-mobile-pay-login/media/logo.png",

Can you confirm that you are not receiving the scripts through our Management API page?
If you do receive them, by using the icon_url and scripts parameters you should be able to update the logo!

Kind Regards,
Nik

That is strange.

The output I pasted in my previous reply was indeed from that endpoint unless I am missing something.

curl -s "https://$AUTH0_DOMAIN/api/v2/connections/$CONNECTION_ID" \
  -H "authorization: Bearer $TOKEN" > connection.json

and I am not receiving the scripts in that json output.

I retrieved my token with

curl -s -X POST "https://$AUTH0_DOMAIN/oauth/token" \
  -H 'content-type: application/json' \
  -d "{\"client_id\":\"$M2M_CLIENT_ID\",\"client_secret\":\"$M2M_CLIENT_SECRET\",\"audience\":\"https://$AUTH0_DOMAIN/api/v2/\",\"grant_type\":\"client_credentials\"}" \
  | jq -r '.access_token'

I have toggled on read:connections and update:connections to the Management API for the client I am using.

I also tried running the API through the linked GET page, but the result was identical to the one I pasted earlier.

Can you try this following cURL request? This is the one that is provided to me by the Management API page:

curl -L 'https://{{Auth0_Tenant}}.auth0.com/api/v2/connections/{{connection_ID}}' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {{ManagementAPI_Token}}'

Let me know if the output is different!

Kind Regards,
Nik

1 Like

The solution was in your request there, {{ManagementAPI_Token}}!
Using the Management API Token through the APIs > Auth0 Management API > API Explorer instead of the one for the application I configured myself gave all the data instead of just the previous minimum data.

Thank you for our patience and support!

My pleasure!

I saw in your previous post that you were using an M2M client for the request which probably was missing some permissions.

Glad I could help regarding the matter! If you ever have any other questions or issues, feel free to post again on the community!

Kind Regards,
Nik

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.