Single Sign-On Token Errors

Problem

While attempting to use WHMCS single sign-on to authenticate, users see the following error:

Unable to authenticate with Single Sign-On token for User ID: xx

Cause

This error indicates that the single sign-on token failed authentication for an unspecified reason. The token may be invalid, expired, or corrupted.

Troubleshooting

To troubleshoot the issue, ensure that:

  • Token token generation used one of the following methods:
    • For API-based single sign-on, confirm that the CreateSsoToken API function executed successfully.
    • For OAuth-based single sign-on, verify that the OAuth Token API Endpoint returned a valid access token.
  • The token has not expired. Single sign-on tokens are single-use and have limited validity periods.
  • The user ID exists and corresponds to a valid client.
  • The client status is Active or Inactive, not Closed.
    For steps to correct this issue, see Single Sign-On Closed User Errors.

Solution

To resolve this error:

  1. Generate a new single sign-on token using your chosen method.
  2. Verify the token generation process completed without errors.
  3. Immediately redirect the user to the returned redirect_url or Single Sign-On API Endpoint with the new token.

If the error persists, check the WHMCS system logs for additional error details.

Last modified: 2025 August 6