Tray Embedded / Core Topics / Authentications / Auth-only dialog

Auth-only dialog

Overview

It is possible to allow your users to complete the authentication step using an auth-only dialog, instead of the Configuration Wizard.

This is useful for integrations that do not require End Users to carry out any personalization beyond authenticating with services.

You can see an example of this being put to use in our demo app with onCreateAuth at https://github.com/trayio/embedded-edition-sample-app/blob/master/src/components/Instance.js

Note on whitelabelling

Whitelabelling the url

Note that you can use an iFrame to present this if you wish to 'whitelabel' and hide the https://embedded.tray.io url. If you wish to do this your domain will need to be added to our whitelist. Please contact us at support@tray.io to arrange this.

You can also whitelabel the url using a custom domain as explained in our page on whitelabelling public urls

Whitelabelling the dialog CSS

Please see our guide to whitelabelling auth-only dialog CSS for instructions.

Using auth-only dialog

In order to use an auth-only dialog you will need to:

  1. When editing your Solution, pick up the External ID for the authentication from the Configuration section:

set-external-id

2. Use the Create Solution Instance mutation to generate a solutionInstanceId for the End User (this requires an access token for your End User as per Create User Token)

3. When the End User clicks the relevant button in your app UI, the auth-only dialog is then initiated with a url which contains the externalAuthId and solutionInstanceId obtained in steps 1 and 2:

https://embedded.tray.io/external/auth/create/{partnerName}/{solutionInstanceId}/{externalAuthId}?code={authorizationCode}

Remember that partnerName is set in the Profile section of the dashboard, as explained here.

{authorizationCode} is the one-time use code that must be generated as per Create Config Wizard Authorization Code

An example url would then be:

https://embedded.tray.io/external/auth/create/acme/8b4fc48f-9fcd-43dw-ufu1-1b7a788983c6/external_slack_authentication?code=37d1a4fa990fb412efuh232310ad44ddbc5caed5d

The End User will then be presented with an authentication dialog for the service being authenticated with.

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

4. Final step is to use the Update Solution Instance mutation to update the solutionInstanceId with authValues for the End User (this requires an access token for your End User as per Create User Token)