Thank you @jefflee-figma for additional support on this.
@developer12 - We are actively fixing this for net-new connections such that they are not impacted by this. For your existing connection, you can update the tokenUrl using the management API.
To update your tokenUrl for your Figma connection:
- Call GET Connections or if you know the connection id, you can call GET Connection by Id. The Id is available in your Admin Dashboard in the connection settings.
- In the response, copy the
options
object from the figma connection. This will be used in the update request.
Example options object:
"options": {
"scope": "file_read",
"scripts": {
"fetchUserProfile": "function fetchUserProfile(accessToken, context, callback) {\n request.get({\n url: 'https://api.figma.com/v1/me',\n headers: {\n 'Authorization': 'Bearer ' + accessToken,\n }\n },\n (err, resp, body) => {\n if (err) {\n return callback(err);\n }\n\n if (resp.statusCode !== 200) {\n return callback(new Error(`[Response code: ${resp.statusCode}] ${body}`));\n }\n\n let bodyParsed;\n try {\n bodyParsed = JSON.parse(body);\n } catch (jsonError) {\n return callback(new Error(body));\n }\n\n bodyParsed.user_id = bodyParsed.id;\n bodyParsed.name = bodyParsed.handle;\n return callback(null, bodyParsed);\n });\n}"
},
"icon_url": "https://cdn.auth0.com/marketplace/catalog/content/assets/creators/figma/figma-avatar.png",
"tokenURL": "https://www.figma.com/api/oauth/token",
"client_id": "fake_client_id_n4GP6UrdX2P",
"client_secret": "fake_client_secret_63ScVTzmxWt3",
"authorizationURL": "https://www.figma.com/oauth",
"integration_name": "figma"
}
- In the options object, change the tokenURL value to:
https://api.figma.com/v1/oauth/token
Example updated options
object:
Example options object:
"options": {
"scope": "file_read",
"scripts": {
"fetchUserProfile": "function fetchUserProfile(accessToken, context, callback) {\n request.get({\n url: 'https://api.figma.com/v1/me',\n headers: {\n 'Authorization': 'Bearer ' + accessToken,\n }\n },\n (err, resp, body) => {\n if (err) {\n return callback(err);\n }\n\n if (resp.statusCode !== 200) {\n return callback(new Error(`[Response code: ${resp.statusCode}] ${body}`));\n }\n\n let bodyParsed;\n try {\n bodyParsed = JSON.parse(body);\n } catch (jsonError) {\n return callback(new Error(body));\n }\n\n bodyParsed.user_id = bodyParsed.id;\n bodyParsed.name = bodyParsed.handle;\n return callback(null, bodyParsed);\n });\n}"
},
"icon_url": "https://cdn.auth0.com/marketplace/catalog/content/assets/creators/figma/figma-avatar.png",
"tokenURL": "https://api.figma.com/v1/oauth/token",
"client_id": "fake_client_id_n4GP6UrdX2P",
"client_secret": "fake_client_secret_63ScVTzmxWt3",
"authorizationURL": "https://www.figma.com/oauth",
"integration_name": "figma"
}
- Using the PATCH Connection by Id you can update the options object.
Example PATCH Request (Pass connection id in URL path and only options object)
PATCH https://{domain url}/api/v2/connections/con_Irocg2BrE5sMurE8
{
"options": {
"scope": "file_read",
"scripts": {
"fetchUserProfile": "function fetchUserProfile(accessToken, context, callback) {\n request.get({\n url: 'https://api.figma.com/v1/me',\n headers: {\n 'Authorization': 'Bearer ' + accessToken,\n }\n },\n (err, resp, body) => {\n if (err) {\n return callback(err);\n }\n\n if (resp.statusCode !== 200) {\n return callback(new Error(`[Response code: ${resp.statusCode}] ${body}`));\n }\n\n let bodyParsed;\n try {\n bodyParsed = JSON.parse(body);\n } catch (jsonError) {\n return callback(new Error(body));\n }\n\n bodyParsed.user_id = bodyParsed.id;\n bodyParsed.name = bodyParsed.handle;\n return callback(null, bodyParsed);\n });\n}"
},
"icon_url": "https://cdn.auth0.com/marketplace/catalog/content/assets/creators/figma/figma-avatar.png",
"tokenURL": "https://api.figma.com/v1/oauth/token",
"client_id": "fake_client_id_n4GP6UrdX2P",
"client_secret": "fake_client_secret_63ScVTzmxWt3",
"authorizationURL": "https://www.figma.com/oauth",
"integration_name": "figma"
}
}
Hope this helps and apologies for the inconvenience.
Thanks,
Brandon
Auth0 Product Manager