Meet Toki Operator

Docs/Merchants/Integrations & API

Customer sign-in with Toki

Last updated

The customer identity provider lets customers use their Toki account to sign in to any compatible OIDC client, including Shopify customer accounts. You generate a set of credentials once, enter them in your OIDC client, and paste the client's URLs back into Toki. From then on, customers can sign in with the same methods they use for your loyalty wallet.

During sign-in, Toki shares a unique customer ID, the customer's email address, and their first and last name when they have entered them. Nothing else from their loyalty account, such as points or tiers, is shared.

Where to find it

  1. Open Integrations.
  2. On the Shopify row, click Manage.
  3. Scroll to the Customer identity provider section. The badge next to the title shows the current status.

Before you start

  • Your loyalty wallet must offer at least one sign-in method that Toki runs itself. In Design, click Edit on the Wallet module, open the Auth Screen section, and check that Login authorization type includes Magic Link, Auth code, Social Login, or Email & Password. Customers use one of these methods to sign in to Toki.
  • Leave the Multi Pass Token field on the Manage Shopify page empty. Toki signs customers in through either the identity provider or Shopify Multipass, never both at the same time. See Identity provider or Shopify Multipass.

Step 1: Generate credentials

  1. In the Customer identity provider section, click Generate OIDC credentials.
  2. Copy the Client secret right away. Toki shows it only once, in a notice that reads "Copy this client secret now. It will not be displayed again." Use the Copy button next to it.

The status changes to Draft, and the section now shows two numbered groups of fields.

Step 2: Enter the Toki values in your OIDC client

The group 1. Enter these Toki values in your OIDC client lists the values your client needs. Each field has a Copy button, and the field names match the setup fields of a typical OIDC client.

Field in TokiWhat to do with it
Well-known or discovery endpoint URLPaste it into your client's discovery URL field.
Client IDPaste it into your client's client ID field.
Client secretPaste the secret you copied in step 1.
Additional scopes (other than openid and email)Add the scope shown, offline_access, to your client's scopes.
Post-sign-out redirect URI parameter nameEnter the value shown, post_logout_redirect_uri, if your client asks for it.

Step 3: Copy your client's URLs into Toki

Your OIDC client shows the URLs it uses to finish a sign-in and a sign-out. Enter them in the group 2. Copy these URLs from your OIDC client into Toki.

  1. Paste the client's callback URLs into Callback URLs, one per line.
  2. Paste the client's sign-out URLs into Sign-out URLs, one per line.
  3. Click Save in the bar at the top of the page.

Enter at least one URL in each field. Every URL must start with https:// and match what your client shows, character for character. After you save, the status changes to Ready to test.

Set up Shopify customer accounts

Shopify customer accounts work as an OIDC client. Here is the full flow in Shopify terms.

  1. In Toki, generate credentials as described in step 1.
  2. In your Shopify admin, open Settings, then Customer accounts, then Authentication. The Identity provider settings are on that page.
  3. Select Custom or other as the provider.
  4. Paste the Toki values from step 2: the discovery URL, the Client ID, the Client secret, the additional scope offline_access, and the post-sign-out redirect URI parameter name post_logout_redirect_uri.
  5. Copy the callback and sign-out URLs Shopify shows you, paste them into Callback URLs and Sign-out URLs in Toki, and click Save.
  6. Back in Shopify, run Test connection.

Shopify's own guide to customer accounts is at help.shopify.com.

Statuses

StatusWhat it means
Not configuredNo credentials yet. Click Generate OIDC credentials to start.
DraftCredentials exist. Callback and sign-out URLs are not saved yet.
Ready to testURLs are saved. Toki is ready for a sign-in from your OIDC client.
ActiveA sign-in has completed through Toki.
DisabledYou turned the provider off. Toki no longer signs customers in.

Rotate the client secret

Rotate the secret whenever you want a fresh one, for example after a team member who knew it leaves.

  1. Next to Client secret, click Rotate secret.
  2. Copy the new secret from the notice. As with the first secret, Toki shows it only once.
  3. Paste the new secret into your OIDC client.

The previous secret keeps working for 24 hours after you rotate, so customer sign-ins continue while you update your client.

Disable the provider

Click Disable provider at the bottom of the section. The status changes to Disabled, Toki stops signing customers in, and sign-in access that Toki granted earlier is revoked. Your credentials and URLs stay in place.

Identity provider or Shopify Multipass

Toki offers two ways to connect customer sign-in with Shopify: the identity provider described here, and Shopify Multipass, set up through the Multi Pass Token field on the same Manage Shopify page. Use one or the other.

  • To use the identity provider, keep Multi Pass Token empty. If a token is saved, Toki shows a notice and keeps the identity provider controls read-only until you remove it.
  • While the identity provider is Draft, Ready to test, or Active, the Multi Pass Token field is read-only. Click Disable provider first if you want to switch to Multipass.

Turn on Shopify Multipass

Shopify Multipass is part of Shopify Plus, and Shopify keeps it for stores that already use it: it is no longer offered to new stores. With Multipass, a customer who signs in to the Toki wallet is signed in to their Shopify customer account at the same time.

  1. In your Shopify admin, open Settings, then Customer accounts. If your store uses new customer accounts, open Authentication on that page.
  2. In the Multipass section, select Turn on. Shopify asks you to confirm your identity, then shows the Multipass secret.
  3. In Toki, open Integrations and click Manage on the Shopify row.
  4. Paste the secret into Multi Pass Token and click Save in the bar at the top of the page.

Automatic sign-in from your store

If a customer is signed in to their customer account on your store, Toki signs them in to the wallet automatically when they visit your store. This works however they signed in: with your store's own sign-in, through the identity provider, or through Multipass.

The setting is Automatically log in users in the Global store settings section of the Loyalty page, and it is on by default. To change it, check or uncheck it and click Save in the bar at the top of the page.

Wallet sign-in with Customer SSO

With Customer SSO, customers sign in to your loyalty wallet through your store's customer accounts, and so through the identity provider. The wallet's sign-in screen then shows a Continue button in place of the sign-in options. It takes the customer to your store's sign-in, where they use one of your Toki sign-in methods on the identity provider's sign-in page. They come back to the page they started on, signed in to your store and to the wallet.

  1. Check that the provider's status is Active. Toki saves Customer SSO only once it is.
  2. In Design, click Edit on the Wallet module and open the Auth Screen section.
  3. In Login authorization type, remove Shop Auth and Log in with Shop, then select Customer SSO. It can't be combined with those two.
  4. Keep at least one of Magic Link, Auth code, Social Login, or Email & Password selected. Customers sign in with it on the identity provider's sign-in page.
  5. Click Save in the bar at the top of the page.

Signing out of the wallet then also signs the customer out of your store. When customers come back from your store's sign-in, Automatically log in users is what signs them in to the wallet, so keep it on. See Automatic sign-in from your store.

Customer SSO works while the provider is Active. At any other status, for example after you disable the provider, the wallet shows your other sign-in methods instead. To save changes to the Wallet module while the provider isn't Active, remove Customer SSO from Login authorization type first.

Customize the sign-in email

When customers sign in with Magic Link or Auth code, in the wallet or on the identity provider's sign-in page, Toki emails them a sign-in link or a six-digit code. You decide who the email comes from and what it says.

  1. Open Loyalty and scroll to Email Settings.
  2. Fill in Sender Address, the part of the address before the @ (the domain is shown next to the field), and Sender Name. Gift card emails and the emails your workflows send use the same sender.
  3. Next to Template settings, click Show.
  4. On the Magic Link tab, edit Magic Link Subject and Magic Link Template. On the Auth Code tab, edit Auth Code Subject and Auth Code Template.
  5. Click Save in the bar at the top of the page.

The templates are HTML. Toki replaces two placeholders when it sends the email:

PlaceholderWhere it worksWhat it becomes
{magicLinkUrl}Magic Link TemplateThe customer's sign-in link.
{emailDigitalCode}Auth Code Subject and Auth Code TemplateThe customer's six-digit code.

The link or code appears only where its placeholder is, so keep it in your template.

Related

Didn't find what you need? Chat with us — a human answers, usually within the hour.