Customer Portal lets your customers to manage their account and billing themselves. Chargebee supports Single Sign-on (SSO) to access the customer portal. If you already have your own authentication for your website, it allows your authenticated customers to access their portal without having to login again.
Note: You can instead allow your customers to access the portal via login page provided by Chargebee. Read more.
Please follow the below steps for supporting portal access via SSO:
{your_website_url}/portal_link).Notes about access URL:
Note: This feature is not supported in in-app portal.
Chargebee allows you to integrate your website by building user authentication on top of Chargebee. If you would want to allow access to parts of your website only to subscribers (like a paywall), you can integrate Chargebee's authentication without having to handle it from your end.
Workflow:
Users should be redirected to the portal login URL - https://yourdomain.chargebeeportal.com/portal/login by passing the following parameters:
Upon successful authentication, a session is created for the user and Chargebee redirects the user to the return_url along with the following parameters:
{
"access_url": "https://yourapp.chargebeeportal.com/portal/access/__test__Lu9rnqItHAdfpSIyeyTbi1YYIxBCc2dq",
"created_at": 1517506765,
"customer_id": "__test__5SK0bLNFRFuCK5OOQ",
"expires_at": 1517510365,
"id": "portal___test__5SK0bLNFRFuCK5rOS",
"linked_customers": [
{
"customer_id": "__test__5SK0bLNFRFuCK5OOQ",
"has_active_subscription": false,
"has_billing_address": false,
"has_payment_method": false,
"object": "linked_customer"
}
],
"object": "portal_session",
"redirect_url": "https://yourdomain.com/users/3490343",
"status": "created",
"token": "__test__Lu9rnqItHAdfpSIyeyTbi1YYIxBCc2dq"
}Creates a portal session for a customer. The session resource in the response contains the access URL. Forward the customer to that access URL. If you would like to logout the customer later via API call, you need to store the id of the portal session resource returned by this API. While creating a session, you also need to pass the redirect URL to which your customers will be sent to upon logout from the portal UI.
This API retrieves a portal session using portal_session_id
as a path parameter.
Logs out the portal session. Typically this should be called when customers logout of your application.
If this API is called for a Portal Session that currently is in :
When an user is sent back to your return URL with session details, you should validate that information by calling this API. The details passed to the return_url should be sent as below:
Note: This API is not applicable for in-app portal.