Mapping and editing Auths
Mapping AuthenticationsCopy
In order to map an End User's Authentications to their Solution Instances, you can run a GraphQL query which combines listing their Solution Instances and Authentications.
This query requires a User access token (obtained as per Create User Token) to be passed as the Bearer in the request header:
1query {2viewer {3solutionInstances {4edges {5node {6id7name8authValues {9authId10externalId11}12}13}14}15authentications {16edges {17node {18id19name20}21}22}23}24}
An example result would be:
1{2"data": {3"viewer": {4"solutionInstances": {5"edges": [6{7"node": {8"id": "5f85b697-7b1b-4a1b-9c8f-5d7dabe22634",9"name": "Slack channel solution 1",10"authValues": [11{12"authId": "569adf96-3c05-40a6-b565-07e829d2c56d",13"externalId": "external_slack_authentication"14}15]16}17},18{19"node": {20"id": "41bbe979-d162-4c02-b03b-e8ca7f5c02f5",21"name": "Slack and Trello solution 1",22"authValues": [23{24"authId": "0b07a653-fbc3-4e91-9893-b8d4121471c3",25"externalId": "external_trello_authentication"26},27{28"authId": "a29d8a87-4b58-49a3-928d-99901f41c698",29"externalId": "external_slack_sales_dept_authentication"30}31]32}33}34]35},36"authentications": {37"edges": [38{39"node": {40"id": "569adf96-3c05-40a6-b565-07e829d2c56d",41"name": "Roger Ramjet's Slack Account"42}43},44{45"node": {46"id": "0b07a653-fbc3-4e91-9893-b8d4121471c3",47"name": "Roger Ramjet's Trello Account"48}49},50{51"node": {52"id": "a29d8a87-4b58-49a3-928d-99901f41c698",53"name": "Roger Ramjet's Slack Account 2"54}55}56]57}58}59}60}
This information can then be used to map Instances and Authentications in your application.
Note that the above example shows that one End User can have two different authentications for the same service - in this case for Slack authentications. The authId tells you which auth has been used for which Solution Instance.
The unifying identifier here is the authId - this can be used to map any of the other values such as name and id of the Solution / Instance and name of the Authentication,
Note also that externalId is an auto-set value which you can edit when creating your Solution:
externalId is primarily used for importing already-made authentications, when it is passed along with authId to identify what service within the solution the authentication is for.
Editing AuthenticationsCopy
If an End User needs to edit an authentication you can allow them to do this with the following url which accepts the authid:
https://embedded.tray.io/external/auth/edit/embeddedId/authId?code=authorizationCode
Remember that embeddedId
is the value that you set when configuring your Config Wizard CSS
And that {authorizationCode} is the one-time use code that must be generated as per Create Config Wizard Authorization Code
You can remove the Tray.io domain and whitelabel the Config Wizard url. If you have done so then embedded.tray.io
will be replaced with e.g. acme.integration-configuration.com
Skipping Auth naming pageCopy
For OAuth services you can skip the title page and go straight to the scopes selection page by adding the skipTitleField=true
query parameter to the above url.
Skipping Auth settings pageCopy
For OAuth services (i.e. non-token-based) you can skip both the title page and settings page (i.e. login details) and go straight to the scopes page by using the skipAuthSettings=true
query parameter.