Detected country: US
logo
Open AppStatusSubmit Ticket
GuideAPI References
‌
‌
‌
logo

Powered by

  • Home
  • Security & Compliance
  • Authentication
  • How can I authenticate users from my website to the Help Center?

How can I authenticate users from my website to the Help Center?

2min read

Share

To enable authentication for your help center website, follow these step-by-step instructions:

:::info Please reach to our support team at support@brainfi.sh to configure custom domain

:::

  1. Set up a custom domain:
    • Obtain a custom domain for your help center website. This domain should match or be a subdomain of your external site's domain. For example, if your app domain is "https://app.example.com," your help center's domain should follow a similar pattern "https://help.example.com"
  2. Enable cookie forwarding:
    • Access your domain registrar or DNS provider and configure the necessary DNS records to point your custom domain to your help center's hosting environment.
    • Enable cookie forwarding on your hosting environment. This ensures that cookies set by your external site can be forwarded to the help center domain during authentication.
  3. Configure authentication settings:
    • Log in to your help center's administrative interface.
    • Navigate to the Settings section and locate the Help desk or Help center settings.
    • Look for the Advanced or Authentication section within the settings.
  4. Enable authentication:
    • Within the Advanced or Authentication section, enable authentication for your help center website.
    • This option might be labeled as "Enable authentication" or similar.
  5. Obtain a signing secret:
    • Copy the signing/authentication secret from Advanced settings tab.
    • This signing secret will be used to create a JSON Web Token (JWT) containing user details during authentication.
  6. Configure Authentication URL:
    • In the authentication settings, locate the field for the Authentication URL.
    • Enter the URL that your help center should use to make a request and authenticate the user.
    • This URL will typically accept a cookie or bearer token for authentication purposes.
  7. Create signed JWT tokens with user details:
    • Use the signing secret obtained in the above step to create JWT tokens.
    • The JWT tokens will be used to authenticate users on your help center website
  8. Configure Redirect URL:
    • In the authentication settings, locate the Redirect URL field.
    • Specify the URL where users should be redirected if authentication fails or is not successful.
    • This URL could be a page on your help center or your external site.
  9. Save and test:
    • Save the authentication settings in your help center's administrative interface.
    • Test the authentication process by visiting your help center website and attempting to authenticate using the specified method.
    • Ensure that users can successfully log in and access authenticated features.

By following these steps, you can enable authentication for your help center website and integrate it with the same authentication method used on your external site.

FAQs

How to sign JWT token using shared secret

// Example usage using NodeJS 
const jwt = require('jsonwebtoken'); 
const payload = {
  user: {
    name: '#{customerName}',
    email: '#{customerEmail}',
    external_id: '#{externalId}'
  },
  metadata: {} // any additional information
};
const token = jwt.sign(payload, '#{yourSecret}');

What is response structure for authentication request?

// JSON body payload response structure for authentication request
{
 "token": "<signed-token>"
}

Share