---
title: How to configure single sign-on (SSO) with JWT protocol
description: Learn how to configure Single Sign-On (SSO) integration with JWT for secure and seamless login in vFairs events.
---

[Skip to content](https://help.vfairs.com/knowledge/how-to-configure-single-sign-on-sso-with-jwt-protocol#main-content)

English

Show submenu for translations

[Customer portal](https://support.vfairs.com/care?hsLang=en)

Open main navigation

Close main navigation

- English
  
  Show submenu for translations
- [Customer portal](https://support.vfairs.com/care)

 Welcome to vFairs Help Center

- There are no suggestions because the search field is empty.

1. [Help Center](https://help.vfairs.com/knowledge?hsLang=en)
2. [Integrations](https://help.vfairs.com/knowledge/integrations?hsLang=en)

# How to configure single sign-on (SSO) with JWT protocol

## Learn how to configure Single Sign-On (SSO) integration with JWT for secure and seamless login in vFairs events.

### **Overview**

**JSON Web Token (JWT)** is a compact, URL-safe means of representing claims to be transferred between two parties. It is used for authentication and information exchange.

A JWT is composed of three parts:

- **Header:** Contains metadata about the token, including the type of token and the signing algorithm used.

- **Payload:** Contains the claims (statements about an entity and additional data), such as user ID, roles, and permissions.

- **Signature:** A cryptographic signature that verifies the integrity of the token and authenticates the sender. It is created using the header, payload, and a secret key.

### **Configure your JWT Implementation**

To set up Single Sign-On (SSO) for a user using JSON Web Tokens (JWT) with vFairs, follow the steps below:

**Prerequisites**

- **User Management System:** Ensure you have a system that can manage user authentication and generate user attributes.

- **Secret Key:** Navigate to Event Setup \>\> API tab \>\> copy APP Key value or ask

your vFairs project manager. This key is used to sign your JWT.

#### **Step # 01: Prepare the JWT Payload**

**1.1 Define Required Attributes:** You must include the following mandatory user attributes in the JWT payload:

- - first\_name: User’s first name (Mandatory)

- - last\_name: User’s last name (Mandatory)

- - email: User’s email address (Mandatory, used for unique identification)

- - You can also include additional user profile data as needed, which will be synchronized between your user management system and vFairs.

**1.2 Create the JWT Header**: Specify the JWT algorithm in the header. Use the following JSON structure: {"typ": "JWT", "alg": "HS256"}

- **HS256**: This stands for HMAC SHA 256, a secure encryption algorithm developed by the  U.S. National Security Agency.

**1.3 Construct the JWT Payload**: Construct your JWT payload by including the user attributes prepared in point 1. The payload must be formatted as a JSON object.

**1.4 Sign the JWT**: Implementing JWT requires using a secret key and a hashing algorithm to generate a secure token. Your vFairs project manager will provide the necessary secret key.

#### **Step # 02: Encode the JWT**

**Base64 Encode the JWT**: Once the JWT is constructed, encode it using Base64 encoding.

#### **Step # 03: Redirect User to vFairs**

**3.1 Prepare the Redirect URL**: Redirect the user to the vFairs SSO endpoint using the following URL format:  
[https://mycompany.vfairs.com/en/sso\_login?jwt={base64\_encoded\_payload](https://mycompany.vfairs.com/en/sso?jwt=%7Bbase64_encoded_payload)}   
Ensure the JWT payload is appended as a query string after the jwt= parameter.

**3.2 Use HTTPS Protocol**:  Ensure that the JWT payload is sent to your vFairs Event subdomain using the HTTPS protocol. 

Note: Host-mapped subdomains are not supported; ensure you are using the correct subdomain.

**3.3 Session Granting:** vFairs receives the request and parses the user details from the JWT payload. If the token is valid and the user details are correct, vFairs grants the user a session, allowing access to the event.

#### **Step # 04: Handle the Return URL (Optional)**

**4.1 Extract the return\_to Parameter:** When vFairs redirects a user to your login script, it will include a return\_to parameter in the URL. This parameter indicates the page to which the user should be redirected after successful authentication.e.g.[https://mycompany.com/vfairs/sso\_login?return\_to=https://mycompany.vfairs.com/en/sso\_login](https://mycompany.com/vfairs/sso_login?return_to=https://mycompany.vfairs.com/en/sso_login) 

**4.2 Submit the JWT:** When submitting the JWT token back to vFairs, include the return\_to value from the invoked URL in your submission.

 

**Notes:**

- **Browser-Based Redirects:** The entire process relies on browser redirects and the secure transmission of signed messages using JWT. All redirects occur within the browser environment, ensuring that there is no direct connection between vFairs and your internal systems.
- **Security:** By handling the authentication process on your side, you can keep your authentication scripts securely behind your corporate firewall, reducing the risk of unauthorized access.

#### **Sample Node.js Code**

 

const jwt = require('jsonwebtoken');

 

// Configuration

const secretKey = 'YOUR\_SECRET\_KEY'; // Replace with the secret key provided by your vFairs project manager.

const vFairsDomain = 'https://mycompany.vfairs.com/en/sso'; // Replace with your vFairs subdomain.

 

// Function to create a JWT for SSO

function createJWT(userAttributes) {

    // 1. Define JWT header

    const header = {

        typ: 'JWT',

        alg: 'HS256'

    };

 

    // 2. Create the JWT payload

    const payload = {

        email: userAttributes.email, // Required attribute

        firstName: userAttributes.firstName || '', // Optional

        lastName: userAttributes.lastName || '', // Optional

        // Add any other optional attributes here

    };

 

    // 3. Sign the JWT with the secret key

    const token = jwt.sign(payload, secretKey, { header });

 

    return token;

}

 

// Function to redirect user to vFairs with the JWT

function redirectToVFairs(userAttributes) {

    const jwtToken = createJWT(userAttributes);

    

    // 4. Construct the redirect URL

    const redirectURL = \`${vFairsDomain}?jwt=${encodeURIComponent(jwtToken)}\`;

    

    // 5. Redirect the user (this example just logs the URL)

    console.log(\`Redirecting to: ${redirectURL}\`);

    

    // In an actual web server implementation, you might use:

    // res.redirect(redirectURL);

}

 

// Example user attributes

const userAttributes = {

    email: 'user@example.com', // Required

    firstName: 'John', // Optional

    lastName: 'Doe' // Optional

};

 

// Redirect the user

redirectToVFairs(userAttributes);

- [Organization Management](https://help.vfairs.com/knowledge/organization-management?hsLang=en)
- [Event Setup & Navigation](https://help.vfairs.com/knowledge/event-setup-navigation?hsLang=en#main-content)

    - [Document Library](https://help.vfairs.com/knowledge/event-setup-navigation?hsLang=en#document-library)
    - [Translations And Labels](https://help.vfairs.com/knowledge/event-setup-navigation?hsLang=en#translations-and-labels)
- [Attendee Management](https://help.vfairs.com/knowledge/attendee-management?hsLang=en)
- [Agenda Management](https://help.vfairs.com/knowledge/agenda-management?hsLang=en#main-content)

    - [Session Management](https://help.vfairs.com/knowledge/agenda-management?hsLang=en#session-management)
    - [Speaker Management](https://help.vfairs.com/knowledge/agenda-management?hsLang=en#speaker-management)
- [Speaker Management](https://help.vfairs.com/knowledge/speaker-management?hsLang=en)
- [Event Website & Landing Pages](https://help.vfairs.com/knowledge/event-website-landing-pages?hsLang=en#main-content)

    - [Web Page Management](https://help.vfairs.com/knowledge/event-website-landing-pages?hsLang=en#web-page-management)
- [Registration & Ticketing](https://help.vfairs.com/knowledge/registration-ticketing?hsLang=en#main-content)

    - [Registration](https://help.vfairs.com/knowledge/registration-ticketing?hsLang=en#registration)
    - [Ticketing](https://help.vfairs.com/knowledge/registration-ticketing?hsLang=en#ticketing)
    - [Payments](https://help.vfairs.com/knowledge/registration-ticketing?hsLang=en#payments)
- [Exhibitor Management](https://help.vfairs.com/knowledge/exhibitor-management?hsLang=en#main-content)

    - [Booth Negotiation](https://help.vfairs.com/knowledge/exhibitor-management?hsLang=en#booth-negotiation)
    - [Task Management](https://help.vfairs.com/knowledge/exhibitor-management?hsLang=en#task-management)
    - [Booth Management](https://help.vfairs.com/knowledge/exhibitor-management?hsLang=en#booth-management)
    - [Document / Video](https://help.vfairs.com/knowledge/exhibitor-management?hsLang=en#document-video)
    - [Jobs](https://help.vfairs.com/knowledge/exhibitor-management?hsLang=en#jobs)
- [Sponsor Management](https://help.vfairs.com/knowledge/sponsor-management?hsLang=en)
- [Networking](https://help.vfairs.com/knowledge/networking?hsLang=en#main-content)

    - [Chat](https://help.vfairs.com/knowledge/networking?hsLang=en#chat)
    - [Chat Queue](https://help.vfairs.com/knowledge/networking?hsLang=en#chat-queue)
    - [Video Matchmaking](https://help.vfairs.com/knowledge/networking?hsLang=en#video-matchmaking)
    - [Reports](https://help.vfairs.com/knowledge/networking?hsLang=en#reports)
    - [Meeting](https://help.vfairs.com/knowledge/networking?hsLang=en#meeting)
- [Engagement](https://help.vfairs.com/knowledge/engagement?hsLang=en#main-content)

    - [Certificate Management](https://help.vfairs.com/knowledge/engagement?hsLang=en#certificate-management)
    - [Scavenger Hunt](https://help.vfairs.com/knowledge/engagement?hsLang=en#scavenger-hunt)
    - [Notifications](https://help.vfairs.com/knowledge/engagement?hsLang=en#notifications)
    - [Survey](https://help.vfairs.com/knowledge/engagement?hsLang=en#survey)
    - [LeaderBoard](https://help.vfairs.com/knowledge/engagement?hsLang=en#leaderboard)
    - [Quiz](https://help.vfairs.com/knowledge/engagement?hsLang=en#quiz)
- [Reports & Analytics](https://help.vfairs.com/knowledge/reports-analytics?hsLang=en#main-content)

    - [Registration and Ticketing](https://help.vfairs.com/knowledge/reports-analytics?hsLang=en#registration-and-ticketing)
    - [User Journey Tracker](https://help.vfairs.com/knowledge/reports-analytics?hsLang=en#user-journey-tracker)
    - [Post Event PDF Report](https://help.vfairs.com/knowledge/reports-analytics?hsLang=en#post-event-pdf-report)
    - [Survey](https://help.vfairs.com/knowledge/reports-analytics?hsLang=en#survey)
    - [Cross Event Report & Reporting 360](https://help.vfairs.com/knowledge/reports-analytics?hsLang=en#cross-event-report-reporting-360)
- [Marketing](https://help.vfairs.com/knowledge/marketing?hsLang=en#main-content)

    - [Email Campaigns](https://help.vfairs.com/knowledge/marketing?hsLang=en#email-campaigns)
    - [System Emails](https://help.vfairs.com/knowledge/marketing?hsLang=en#system-emails)
    - [SMS Campaign](https://help.vfairs.com/knowledge/marketing?hsLang=en#sms-campaign)
    - [AI Assistant](https://help.vfairs.com/knowledge/marketing?hsLang=en#ai-assistant)
    - [Social Meta](https://help.vfairs.com/knowledge/marketing?hsLang=en#social-meta)
    - [Web Notifications](https://help.vfairs.com/knowledge/marketing?hsLang=en#web-notifications)
- [Accommodation & Budget Management](https://help.vfairs.com/knowledge/accommodation-budget-management?hsLang=en#main-content)

    - [Accommodation](https://help.vfairs.com/knowledge/accommodation-budget-management?hsLang=en#accommodation)
- [Attendee Mobile App](https://help.vfairs.com/knowledge/attendee-mobile-app?hsLang=en#main-content)

    - [Event Assistant](https://help.vfairs.com/knowledge/attendee-mobile-app?hsLang=en#event-assistant)
    - [Getting Started & App Access](https://help.vfairs.com/knowledge/attendee-mobile-app?hsLang=en#getting-started-app-access)
    - [Build & Customize Your App](https://help.vfairs.com/knowledge/attendee-mobile-app?hsLang=en#build-customize-your-app)
    - [Legacy App](https://help.vfairs.com/knowledge/attendee-mobile-app?hsLang=en#legacy-app)
    - [Sessions & Event Content](https://help.vfairs.com/knowledge/attendee-mobile-app?hsLang=en#sessions-event-content)
    - [Engagement & Networking](https://help.vfairs.com/knowledge/attendee-mobile-app?hsLang=en#engagement-networking)
    - [Event Operations & Insights](https://help.vfairs.com/knowledge/attendee-mobile-app?hsLang=en#event-operations-insights)
- [Lead Capture App](https://help.vfairs.com/knowledge/lead-capture-app?hsLang=en#main-content)

    - [Reporting 360](https://help.vfairs.com/knowledge/lead-capture-app?hsLang=en#reporting-360)
- [Badge Printing & Check-in App](https://help.vfairs.com/knowledge/badge-printing-check-in-app?hsLang=en#main-content)

    - [Printers](https://help.vfairs.com/knowledge/badge-printing-check-in-app?hsLang=en#printers)
    - [Badge Design](https://help.vfairs.com/knowledge/badge-printing-check-in-app?hsLang=en#badge-design)
- [Integrations](https://help.vfairs.com/knowledge/integrations?hsLang=en#main-content)

    - [Custom Workflow](https://help.vfairs.com/knowledge/integrations?hsLang=en#custom-workflow)
- [E-commerce](https://help.vfairs.com/knowledge/e-commerce?hsLang=en#main-content)

    - [Product Management](https://help.vfairs.com/knowledge/e-commerce?hsLang=en#product-management)
    - [Allowance Negotiation](https://help.vfairs.com/knowledge/e-commerce?hsLang=en#allowance-negotiation)
- [Venue Builder](https://help.vfairs.com/knowledge/venue-builder?hsLang=en)
- [Abstract Management](https://help.vfairs.com/knowledge/abstract-management?hsLang=en)
- [Group Meeting](https://help.vfairs.com/knowledge/group-meeting?hsLang=en)
- [Exhibitor Portal](https://help.vfairs.com/knowledge/exhibitor-portal?hsLang=en#main-content)

    - [Booth](https://help.vfairs.com/knowledge/exhibitor-portal?hsLang=en#booth)
- [Search Attendee](https://help.vfairs.com/knowledge/search-attendee?hsLang=en)
- [Data Tags](https://help.vfairs.com/knowledge/data-tags?hsLang=en)
- [Organization Website](https://help.vfairs.com/knowledge/organization-website?hsLang=en)
- [AI Tools](https://help.vfairs.com/knowledge/ai-tools?hsLang=en)

[![vfairs-logo-landscape-gradient-5 (3)-1](https://help.vfairs.com/hs-fs/hubfs/vfairs-logo-landscape-gradient-5%20(3)-1.webp?width=107&height=44&name=vfairs-logo-landscape-gradient-5%20(3)-1.webp "vfairs-logo-landscape-gradient-5 (3)-1")](http://vfairs.com)

vfairs.com Help Center

<https://www.linkedin.com/company/vfairs>

Copyright © 2026, vFairs LLC