This feature is available on the Scale plan. View all plans
Sign customers in to your portal with your own login. You build one endpoint that signs a JWT and redirects back to Productlane.
If you run Multiple Portals, each portal can use its own connection. Settings > Portals > SSO lists the Root portal first, then every named portal, and shows whether each one is enabled, paused, or using the Root portal's connection. A portal with no connection of its own uses the Root portal's. Everything below applies to each portal separately.
Setup
1. Activate SSO
Open Settings > Portals > SSO, pick the portal, and enter the URL of your endpoint. Productlane generates a signing secret and shows it once. Click Copy and close and store it somewhere safe, since it will not be shown again.
2. Build the token endpoint
import jwt from "jsonwebtoken"
import { NextApiRequest, NextApiResponse } from "next"
export default function handler(req: NextApiRequest, res: NextApiResponse) {
// replace with your own session lookup
const session = { email: "[email protected]", name: "Ada" }
const token = jwt.sign(
{
email: session.email,
name: session.name,
imageUrl: "", // optional
orgId: "", // optional, Productlane company id
linearOrgId: "", // optional, Linear customer id
tokenValidity: 15, // optional, in minutes
},
"pl_sso_...",
)
// send users back to the page they asked for
const redirect = req.query.redirect
? `&redirect=${encodeURIComponent(String(req.query.redirect))}`
: ""
// custom domain
res.redirect(`https://support.example.com/api/portal/sso?token=${token}${redirect}`)
// or your Productlane subdomain
// res.redirect(`https://example.productlane.com/api/portal/sso?token=${token}${redirect}`)
}3. Enable SSO
Once the endpoint works, turn on Enable SSO on the portal's SSO page. Traffic starts going to your endpoint right away.
Privacy controls
With SSO active, choose which parts of the portal need a login.
Make the entire portal private
Turn on Make entire portal private to require a login everywhere. The portal is then left out of search engines: robots.txt, the sitemap, and noindex tags all exclude it.
Private sections
To require a login only in some sections, leave the whole portal public and turn on the section toggles:
| Toggle | Section |
|---|---|
| Make Docs private | Docs and help center |
| Make Feature requests private | Roadmap and feature requests |
| Make Changelog private | Changelog |
| Make Support Portal private | Support portal |
Each private section is left out of search engines the same way.
Limit access by email domain or by person
Besides SSO, a portal can require visitors to sign in with a Google account, restricted to the email domains you list under Allowed domains. Anyone with an email at one of those domains can sign in. A named portal can carry its own restriction instead of inheriting the Root portal's. Turning the restriction on for the first time needs the Scale plan or above.
The domain restriction covers Google accounts and whole domains. It cannot name individual people. SSO has no allowed list of its own: your endpoint decides who gets a token. On a portal that also requires sign-in, the email in the token has to pass that portal's Who can sign in list too. To limit docs to named people, or to people who do not sign in with Google, have your endpoint sign a token only for those people.
Choose which portals an SSO login opens
portalScopes is an optional array in the SSO JWT. It lists the slugs of the portals the customer can open. A token from the Root portal's connection that leaves it out opens the Root portal alone.
To show a named portal to selected customers, add its slug to their token. The slug is the path in the portal's URL: support.example.com/enterprise has the slug enterprise. The list is strict, so add "main" to keep the Root portal open as well. A customer who opens a portal outside their list sees "You don't have access to this portal".
The email in the token also has to pass the named portal's Who can sign in list. A token signed with a named portal's own SSO connection opens that portal alone, whatever the claim says.
The widget's userToken takes the claim too. It sets which portals Automatic portal sign-in opens.
{
"email": "[email protected]",
"portalScopes": ["main", "enterprise"]
}Rotate the signing secret
Click Rotate secret in the Credentials section of the portal's SSO page. The old secret stops working at once, so logins fail until your endpoint signs with the new one. Rotate when you can update the endpoint straight away.
Assign users to a company
Productlane assigns users to a company by their email domain. To override that, add one of these optional fields to the JWT:
orgId: the Productlane company idlinearOrgId: the Linear customer id
Use this when a user's email domain does not match their company.
Redirect
When a signed-out user opens a specific page, Productlane passes a redirect parameter to your endpoint. Pass it back in your redirect, as in the example above, to return users to the page they opened.
