Introducing the Chargebee CLI

Error - Session Expired

Problem Statement

How do I set up Chargebee sign-in via SSO? I authenticate customers on my app and want to redirect them to the Chargebee portal without a separate login.

Solution

Use Single Sign-On (SSO) via API so customers authenticated on your site can access the Chargebee portal without logging in again. Chargebee's API creates a portal session and returns an access URL you redirect the customer to.

SSO applies when you use your own authentication. The portal link is valid for one-time use. See Session validity time for portal links.

Steps to Set It Up

  1. Enable Customers can access the self-serve portal via Single Sign-On API under Configure Chargebee > Settings > Checkout & Self-serve portal > Checkout > Publish
  1. Add a link on your site for authenticated customers to open the portal
  2. In your server code, call the Create a portal session API
  3. Redirect the customer to the access_url from the API response

The access URL must be used within one hour. After that, the session is valid until the user logs out or your app calls the logout API. Create a new portal session each time you need to give portal access.

Chargebee also supports SSO via SAML.