Developer Platform
  • Home
  • Getting Started
    • General Information
    • Features Overview
    • Security
  • APPs
    • Public Apps
      • Shopify
      • Salesforce
      • Zendesk
      • Google Analytics
    • Build your App
      • Getting started
      • My Apps
      • App information
      • App Parameters
      • App Plugins
      • Add Webhooks
      • Submit your Apps
      • App security
      • Developer Policy
  • Use Cases
    • Copilots
      • Product Catalog sync through API
      • FAQ sync through API
    • Visitor experience
      • Integrating custom buttons into your site
      • Check availability before escalating to iAdvize
      • Authenticated Messaging
        • Introduction
        • Web client-side implementation
          • Authenticated Messaging overview
          • Brief timeline of the integration process
          • How to enable authenticated mode in the administration portal?
          • How to implement the customer authentication backend (token provider)?
          • How to authenticate with iAdvize in client's website?
          • How to deal with activation success or failure?
          • How to logout?
          • Compatibility with Mobile SDK
          • FAQ
        • Web backend implementation
          • Important information and recommendations
          • Signature and Encryption Detailed Process
          • Technical backend implementation
          • FAQ
      • Cross-domain Conversation Continuity
      • Customize replies with Markdown
    • Agent workspace
      • Custom App example and step-by-step tutorial
        • Get Started
        • Work with the Desk
        • Intent / Trigger
        • JWT
        • References
    • Administration
      • Users
        • SAML SSO Authentication - Implementation Guide
        • Create, update and delete users via API
        • Manage the availability of your users with the iAdvize API
        • Integrate the iAdvize conversation panel into an existing tool
    • Data & Analytics
      • Anonymize a conversation or visitor data
      • Create a custom dashboard
      • Find contact data using GraphQL
      • Retrieve conversations data
      • Retrieve messages exchanged within a conversation
  • Technologies
    • GraphQL API
      • Terminology
      • Reference
      • Authentication
      • Schema lifecycle
      • Error Management
      • Pagination
    • REST API (deprecated)
      • Statistic (deprecated)
      • Group (deprecated)
      • Call meeting (deprecated)
      • Operator (deprecated)
      • Skill (deprecated)
      • Transaction (deprecated)
      • Visitor (deprecated)
    • Webhooks
      • Reference
      • Guides
    • Desk events
      • Reference
    • Web & Mobile SDK
      • Javascript Web SDK
        • Reference
      • Javascript Callbacks
        • Reference
        • Guides
      • Mobile SDK
        • Fourme (latest)
        • Epoisses
        • Dauphin
        • Cantal
        • 🤝Support Policy
        • 🤔Frequently Asked Questions
    • Custom App
    • External Bot
      • Implementation
        • Configuration flow
        • Conversation flow
        • Conversation objects
      • Configuration
      • FAQ
      • Best practices
Powered by GitBook
On this page
  • Where could I find the iAdvize public key?
  • Expiration: session & token
  • How do we know that the visitor is authenticated?
  • When do I need to call the activate function?
  • What happens when a visitor logs in and logs out?
  • My visitor is authenticated (a JWT is in the local storage) but I don’t have a padlock 🔒 on the desk of the agent
  • Activation success or failure
  • How can I test my JWE?
  • JWT not valid

Was this helpful?

  1. Use Cases
  2. Visitor experience
  3. Authenticated Messaging
  4. Web client-side implementation

FAQ

PreviousCompatibility with Mobile SDKNextWeb backend implementation

Last updated 8 months ago

Was this helpful?

Where could I find the iAdvize public key?

Please see

Expiration: session & token

There are 2 distinct things:

  • the that the brand provides, for which we recommend a lifetime of 1 minute (but it could equal the session duration desired by the brand) (by default, it is set at 1 minute).

  • and the lifetime of the iAdvize session, which specifies when the engagement/conversation session must re-verify the visitor's identity, and this one is based on the brand's use case: A bank would prefer a short delay (for example 7 minutes). For an electricity supplier, 20-30 minutes seems acceptable (by default, it is set at 60 minute).

How do we know that the visitor is authenticated?

Read this to see examples of what is seen on the agent side and on the visitor side.

When do I need to call the activate function?

The activate function needs to be called every time that the iAdvize tag is loaded. It means that you will need to call the activate function on every page change, once per page.

What happens when a visitor logs in and logs out?

Visitor id might change during the conversation if the visitor logs in and logs out.

My visitor is authenticated (a JWT is in the local storage) but I don’t have a padlock 🔒 on the desk of the agent

Activation success or failure

How can I test my JWE?

Test your JWE with this GraphQL API call:

curl --request POST \
  --url https://api.iadvize.com/graphql \
  --header 'Authorization: Bearer <REPLACE GRAPHQL BEARER TOKEN HERE>' \
  --header 'Content-Type: application/json' \
  --data '{"query":"mutation TestJWE {\n  testVisitorAuthenticateFromCredentials(input: {projectId: \"YOUR PROJECT SID\", credentials: \"<REPLACE JWE HERE>\"}) {\n    visitorSessionToken {\n      accessToken\n    }\n  }\n}\n","operationName":"TestJWE"}'

Otherwise, with this implementation:

const activation = await iAdvize.activate(async () => {
  return {
    authenticationOption: {
      type: "SECURED_AUTHENTICATION",
      token: visitor_token,
    },
  };
});
console.log(`activation : ${JSON.stringify(activation, null, 2)}`);

You should see this in the console:

activation : {
  "authentication": {
    "option": {
      "type": "SECURED_AUTHENTICATION",
      "token": "<Response token>"
    },
    "status": "authentication-success"
  }
}

Error type

Why it happens

What to do about it

A valid authentication option must be provided,

The brand makes a mistake on authenticaton.option

Give valid arguments: authenticationOption : { type: 'SECURED_AUTHENTICATION', token: visitor_token }

An activation is already ongoing

The brand calls activate several times in a row before resolving the first one

Wait for call to finish (you can await iAdvize.activate)

Can't activate twice, please logout first

The brand calls activate several times in a row after the first has been successfully resolved

Logout before login if already authenticated

Failed to fetch authentication with a server error

Something went wrong on the server side

In this case, there could be different errors: wrong keys, no flag set, wrong token, etc. (this is on the iAdvize side so the client can create a ticket)

Failed to authenticate visitor from credentials : the website is not correctly setup (null)

JWT not valid

Ensure you set all the required claims with the right prefixes

{
        "https://iadvize.com/userId":"myuserid",
        "iss":"https://livechat.iadvize.com",
        "exp":1602060589
}

Ensure the JWT is signed with the right algorithm

{
         "alg": "RS256"
}

Ensure the JWE is encrypted with the right algorithm

{
         "enc": "A256GCM",
         "alg": "RSA-OAEP-256"
}

Ensure you use the right private key and the right iAdvize public key. Ensure iAdvize setup your public key in your settings.

userId defined in the JWE should remain static and constant. Visitor id (used when the visitor isn't authenticated) is different and is an iAdvize internal data. All the cases of authentication during a conversation, that could impact the visitor id (but not the userId) are described .

Be sure, when you are in an authenticated space of your website where the visitor authentication is enabled, to remove the usage of the `extId` system:

2.4 iAdvize Public key (use for Production)
lifetime of the encrypted token
section
here
About the External ID usage (extId)