YourGPT Custom SSO (Single Sign-On) Integration Guide
This integration provides a way for site owners to authenticate their users and interact with YourGPT through a secure API using a custom SSO flow. The process involves generating and managing JWT tokens, validating them via YourGPT, and establishing a secure connection for user authentication.
How to Set Up Custom SSO?
- Log in or sign up for YourGPT.
-
On the right side of the screen click on Account, then click on Settings.
-
from the left side, click on the SSO button
2. Generate SSO Data
Generate an SSO Client ID
and SSO Secret Key
for your organization.
- Copy the
Client ID
&Secert key
3. Generate JWT Token
Generate a JWT token using your SSO Secret Key
as shown in the code below :
4. Verify Token and Authenticate
After generating the JWT token, call this API :
- On success, you will receive the following response with code
200
:
- After receiving the token in response, redirect the user to the following URL:
- If all data is set correctly, the user will log in seamlessly to YourGPT.
- Other possible responses -
5. Handle Email Verification (if needed)
If you receive the response with code 404
, you need to call the following API to confirm login access via email :
- On success, you will receive the following response with code
200
:
- After receiving the code
200
, redirect the user to the following URL:
- Other possible responses :
- Once the user confirms their login access via email, they will be automatically logged into YourGPT. The SSO integration is now complete and ready for use.
Security Considerations
- Never expose your SSO Secret Key in client-side code
- Store credentials securely in environment variables
- Email verification requests are rate-limited (5 requests/minute)