SSO login link
Providing a login link directly in your application is a user-friendly way to implement single sign-on for Chargely. The images below illustrate the user experience of this mechanism.
Your customer logs in to your existing web site.
Your customer clicks the Chargely SSO login link. The login link can be placed anywhere you want inside your application.
Your customer is logged in to their Chargely customer dashboard. No additional passwords required.
Create a refresh token endpoint
The first step to creating a login link is to create a refresh token endpoint on your server; e.g.
This endpoint will be responsible for generating the SSO login URL needed for your customers to access Chargely. The following documents will help you with generating a refresh token.
- :doc:`Refresh token documentation<refresh_token>`
- :ref:`Creating a SSO refresh token with Chargely SDK for PHP<sdk_php_refresh_token>`
- Requesting a refresh token from your server via AJAX.
- Turning any element on your page into a clickable login link. (usually an
<a>tag but it can be anything)
- Refreshing the token so it doesn't expire. SSO tokens expire every 5 minutes so the snippet refreshes every 4:50.
Success! If all goes well your customers can now log into Chargely with the click of a button. Please contact us for assistance if you have any trouble.