This feature is only available on the Business plan. View all plans

You can easily authenticate users on your portal with your existing system by implementing a simple endpoint that generates a JWT and redirects back to Productlane.


Activate SSO

Head to the SSO settings and activate SSO by specifying the URL of the endpoint you plan on using. This will generate the JWT secret, please note it down. It won’t be shown again.


Implement token endpoint

This is an example of what the token endpoint could look like. You need to add the required auth calls on your end, e.g. to redirect unauthenticated users.

import jwt from "jsonwebtoken"
import { NextApiRequest, NextApiResponse } from "next"

export default function handler(
	req: NextApiRequest,
	res: NextApiResponse,
) {
    // replace with your "getSession"
	const session = { email: "", name: "Patrick" }
	const token = jwt.sign(
      		// optional
			imageUrl: "",
      		// optional, in minutes
      		tokenValidity: 15
    // custom domain example
    // subdomain example
    // res.redirect(
	// 	`${token}`,
	// )

Enable SSO

If your endpoint is ready, enable the SSO switch in the SSO settings. This will start routing traffic to your endpoint, so make sure it’s ready.