Skip to content

Connections (SSO)

Connections let your users sign in with external identity providers like Google, GitHub, or any OIDC-compatible service. Each connection is configured per environment and uses the OAuth2/OIDC protocol under the hood.

ProviderStrategyDiscovery URL
GooglegoogleNot required
Microsoft (Azure AD)microsoftNot required
GitHubgithubNot required
FacebookfacebookNot required
DiscorddiscordNot required
GitLabgitlabOptional (for self-hosted)
SlackslackNot required
LinkedInlinkedinNot required
BitbucketbitbucketNot required
Auth0auth0Required
Generic OIDCoidcRequired

The Generic OIDC strategy works with any OpenID Connect provider. Provide the discovery URL (e.g. https://idp.example.com/.well-known/openid-configuration) and Paylent handles the rest.

  1. Your user clicks “Sign in with Google” (or another provider) on the login page
  2. Paylent redirects them to the provider’s authorization endpoint
  3. The user authenticates with the provider
  4. The provider redirects back to Paylent with an authorization code
  5. Paylent exchanges the code for user profile information
  6. If the user already exists (matched by email), they are signed in. If not, a new account is created (when registration is enabled)

Provider credentials (client ID and secret) are encrypted at rest.

Navigate to Connections in the sidebar. Click Add Connection, select a provider, and enter your OAuth credentials. Each provider’s setup form includes instructions for obtaining the client ID and secret from the provider’s developer console.

Terminal window
curl -X POST https://acme-test.paylent.com/api/connections \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "connection",
"attributes": {
"strategy": "google",
"display_name": "Google",
"client_id": "YOUR_GOOGLE_CLIENT_ID",
"client_secret": "YOUR_GOOGLE_CLIENT_SECRET",
"scopes": "openid email profile"
}
}
}'

For providers that require a discovery URL (OIDC, Auth0):

Terminal window
curl -X POST https://acme-test.paylent.com/api/connections \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "connection",
"attributes": {
"strategy": "oidc",
"display_name": "Corporate SSO",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"discovery_url": "https://idp.example.com/.well-known/openid-configuration",
"scopes": "openid email profile"
}
}
}'
FieldRequiredDefaultDescription
strategyYesOne of the supported provider strategies
display_nameYesLabel shown on the login page
client_idYesOAuth client ID from the provider
client_secretYesOAuth client secret from the provider
discovery_urlDependsRequired for oidc and auth0; optional for gitlab
scopesYesopenid email profileSpace-separated OAuth scopes to request
enabledNotrueSet to false to disable without deleting
enforce_ssoNofalseWhen true, forces users to sign in via this provider

Connections can be scoped to a specific organization. This is useful for enterprise customers who need their own SSO provider while other users in the same environment use a different login method.

Terminal window
curl -X POST https://acme-test.paylent.com/api/connections \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "connection",
"attributes": {
"strategy": "oidc",
"display_name": "Acme Corp SSO",
"client_id": "...",
"client_secret": "...",
"discovery_url": "https://login.acmecorp.com/.well-known/openid-configuration"
},
"relationships": {
"organization": {
"data": { "type": "organization", "id": "ORGANIZATION_ID" }
}
}
}
}'

Environment-level connections (no organization) are available to all users. Organization-scoped connections are only shown to members of that organization.

When configuring your OAuth app with the provider, use this callback URL:

https://{environment-handle}.paylent.com/auth/sso/callback

For example: https://acme-test.paylent.com/auth/sso/callback

When a user signs in through an SSO connection:

  • Existing user (by email): The provider identity is linked to the existing account and the user is signed in
  • New user (registration enabled): A new account is created with the profile information from the provider (email, name) and the user is signed in
  • New user (registration disabled): The login is rejected with an error

Each user can have one linked provider identity. If a user already has a different provider linked, they cannot link a second one through SSO — they must sign in with their existing method.

EndpointDescription
GET /auth/sso/:connection_idInitiates SSO login — redirects to the provider
GET /auth/sso/callbackHandles the provider’s callback after authentication

These endpoints are used automatically by the hosted login page. If you’re building a custom login UI, redirect users to /auth/sso/:connection_id to start the SSO flow.