Use SAML for single sign-on (SSO) when an enterprise customer's identity provider or an existing integration requires it. For new web and mobile apps, use OpenID Connect (OIDC) if you can choose the protocol. If you need to support both, an identity broker can handle customers' SAML sign-ins while your app uses OIDC.
Copy link to headingWhat are the differences between SAML, OIDC, and OAuth?
Security Assertion Markup Language (SAML) and OIDC let your app rely on an identity provider (IdP) to authenticate users. OAuth 2.0 controls access to APIs. OIDC builds on OAuth 2.0, so the same provider can issue an ID token for the app and an access token for the API.
An ID token tells the client app who signed in. The client sends an access token to the API, which verifies the token is valid for that API and authorizes the requested operation. Validating an ID token for your app doesn't authorize an API call. The OpenID Connect Core specification defines the ID token, and the OAuth 2.0 framework defines the access token.
OIDC-based workload federation does not require a user sign-in. A build job can present a signed OIDC token to prove its identity to a cloud provider. If the provider's trust policy allows the workload, the provider can exchange the token for short-lived credentials. GitHub Actions workload federation is one example.
Copy link to headingHow does SAML handle enterprise single sign-on?
In an app-initiated sign-in, the app acts as the service provider (SP) and sends an AuthnRequest to the IdP. After the user signs in, the IdP sends back a SAML response containing an assertion for the SP. The app receives the response at its Assertion Consumer Service (ACS) endpoint, validates it, and starts its own session. To establish trust, the SP and IdP configure entity IDs, endpoints, and signing certificates, often by exchanging SAML metadata.
Copy link to headingWhich bindings carry the request and response?
A binding defines how the parties send a SAML message. In a common web SSO setup, HTTP-Redirect sends the request to the IdP, and HTTP-POST sends the response back to the app in browser form. With HTTP-Artifact, the browser carries a reference that the recipient resolves over a protected back channel. The SAML bindings and web SSO profile define which bindings the request and response can use.
Copy link to headingWhat should the app validate?
Use a maintained SAML library to validate the response. Verify any signatures with the configured IdP's trusted keys, and check the requirements for the binding you use:
HTTP-POST: Verify that each assertion is covered by a valid signature on the assertion itself or the enclosing response. To prevent replay, track accepted assertion IDs for as long as the app can accept those assertions.
HTTP-Artifact: Resolve the artifact over a back channel that authenticates both parties, protects message integrity, and keeps the exchange confidential. Mutually authenticated Transport Layer Security (TLS) is one way for the binding to provide these protections. For HTTP-Artifact, the web SSO profile allows an XML signature on the assertion or response but generally does not require one. See the SAML errata for the signature rules.
For either binding, check the expected issuer and audience, the bearer assertion's recipient and expiration, any assertion conditions, and the response destination where applicable. If the app initiated sign-in, match InResponseTo to the outstanding request. If sign-in starts at the IdP, there's no app request to match. Enable unsolicited responses only for connections that need them. Keep the other validation and protection checks in place. SAML Core defines the underlying validation rules.
Copy link to headingHow do you manage certificates and offboarding?
Plan signing certificate rollover for each connection. Find out whether your app or broker refreshes metadata from a trusted source and can accept both keys during rollover. Test the new key before retiring the old one. Track certificate expiration and coordinate updates if you manage metadata manually.
Just-in-time provisioning can create an account at first sign-in. For offboarding, use directory provisioning through the System for Cross-domain Identity Management (SCIM) or another deactivation process. Decide how to revoke or expire existing app sessions. Assertion expiration sets the deadline for accepting the assertion. Manage the app session separately and honor any applicable SAML session limit.
Copy link to headingHow does OIDC sign users in?
Use the authorization code flow with Proof Key for Code Exchange (PKCE). The browser returns a short-lived authorization code to the client, which the client then redeems at the provider's token endpoint. OAuth 2.0 security best practices require PKCE for public clients and recommend it for confidential clients. They advise against the implicit grant and prohibit the password grant.
Start the sign-in. Generate a fresh, random
code_verifier. Hash it with SHA-256, then base64url-encode the digest without padding. Send the result ascode_challengealong withcode_challenge_method=S256,response_type=code,scope=openid, yourclient_id, and a registeredredirect_uri. Send a freshstatevalue tied to the browser session to match the callback to the sign-in and protect against cross-site request forgery. Use a freshnonceto bind the ID token to that sign-in.Check the callback. After sign-in, the provider redirects the browser back with the code and any
statevalue you sent. Before redeeming the code, match the returnedstateto the value you stored for that sign-in. If your client uses multiple authorization servers, defend against issuer mix-up. For example, check the authorization response'sissparameter against the expected issuer before you redeem the code.Redeem the code. Send a token request with
grant_type=authorization_code, the code, the originalcode_verifier, and the sameredirect_uri. The server checks the verifier against the challenge. A confidential client also authenticates using its registered method. A public client sends its client ID without relying on an embedded secret. The provider returns an ID token and an access token. It may also return a refresh token.Validate the ID token before starting a session. Use a maintained OIDC library to verify the signature using the expected issuer's keys and the configured signing algorithms. For asymmetric signatures, use the issuer's trusted JSON Web Key Set (JWKS). Check
iss,aud, andexp. If you sent anonce, check that the token contains the same value. Follow the OIDC validation rules for your client, including any applicable authorized-party checks. The ID token'sissclaim is separate from the authorization response'sissparameter in step 2.
RFC 7636 defines the PKCE parameters. Use registered redirect URIs and require exact matches, except for the loopback port in native apps. For mobile apps, use the system browser for authorization. A browser app with a server can use a backend for frontend to keep OAuth tokens on the server and give the browser a session cookie. If you issue refresh tokens to public clients, use refresh token rotation or sender-constrained refresh tokens.
Configure OIDC discovery for trusted issuers. Providers can publish the old and new signing keys during rollover. Check how your library caches and refreshes those keys, and test rollover before you rely on it in production.
Copy link to headingHow do you support both protocols and migrate without losing accounts?
Keep an existing SAML connection if a customer requires it or if switching protocols would add work without improving sign-in. For new web and mobile clients, choose OIDC if your IdP supports it. When customers bring their own IdPs, a broker can validate their SAML or OIDC sign-ins and act as the OIDC provider for your app. Your app still needs to validate the broker's tokens and enforce tenant membership and permissions.
Copy link to headingMap identities before enabling a new connection
Give each account an internal ID and link each external identity to that ID in the correct tenant. For SAML, ask which identifier the IdP guarantees will stay the same. Use a persistent NameID with its issuer and any applicable scope if the IdP is configured to provide one. An agreed immutable attribute is another option. For OIDC, use the issuer and subject pair (iss and sub). A pairwise OIDC subject can differ across clients in different sectors, even with the same provider. Email addresses can change or be reassigned, so a matching address alone isn't enough to merge accounts. Use a verified mapping approved by the tenant administrator, or a flow that demonstrates control of both identities.
Copy link to headingCut over one tenant at a time
Run both connections in parallel. Set up the OIDC connection alongside the existing SAML connection so you can switch back if needed.
Test identity and access. Confirm that mapped users sign in to their existing accounts, retain the correct roles, and can't access other tenants. Check which claims or provisioning fields supply groups and roles. Test account deactivation and check what happens to active sessions.
Move the tenant to OIDC. Watch for failed sign-ins and duplicate accounts. Retire the SAML connection once OIDC works for that tenant and you no longer need SAML for rollback.
Copy link to headingHow Vercel supports SAML and OIDC
Vercel uses SAML SSO for team access, Vercel Passport for visitor access to protected deployments, and OIDC federation for workload credentials. If your SaaS customers need to bring their own identity providers, set up those connections in your app or through an identity provider or broker. The Auth0 SaaStart template on Vercel shows how a Next.js app can use Auth0 to let business customers configure SAML or OIDC connections.
Copy link to headingRequire company sign-in for team access with SAML SSO
Enterprise includes SAML Single Sign-On (SSO). Pro teams can purchase it as an add-on. Supported providers include Okta, Auth0, and Microsoft Entra ID.
A team Owner can turn on Require Team Members to login with SAML after setting up SAML SSO and signing in with it. With SAML enforcement on, members can access team information only if they used SAML SSO to start their current session.
Copy link to headingAutomate provisioning with Directory Sync
SAML SSO handles sign-in. Use Directory Sync to automate team membership and role management. On Enterprise, Directory Sync uses SCIM to invite users when the directory adds them and remove their team access when the directory removes them.
Copy link to headingRequire company sign-in for internal deployments with Vercel Passport
Vercel Passport is generally available on Enterprise. It sends visitors to your identity provider to sign in before they can view a protected deployment. Vercel Connect stores the provider configuration, and your server-side code can read the visitor's verified identity. See how to set up Passport with Okta or Microsoft Entra ID.
Klaviyo uses Vercel Passport with Okta to keep apps built through its internal program private and require company sign-in by default.
Copy link to headingExchange workload OIDC tokens for cloud credentials
OIDC federation for secure backend access is available on all plans. Builds receive the token in the VERCEL_OIDC_TOKEN environment variable. Vercel Functions receive it in the x-vercel-oidc-token request header. Build tokens expire after one hour. Function tokens for preview and production expire after two hours. Once you configure a trust relationship, a cloud provider such as AWS can exchange a workload token for temporary credentials.
Copy link to headingRestrict preview access with Deployment Protection
Standard Protection is available on every plan and covers all domains except production domains. Pair it with Vercel Authentication on any plan or with Passport on Enterprise.
Copy link to headingOffer Vercel account sign-in in your app
Sign in with Vercel lets users sign in to third-party apps with their Vercel accounts. Vercel's identity provider supports OAuth 2.0 and OIDC. Its authorization endpoint requires PKCE with S256.
Copy link to headingShip SSO-ready apps on Vercel
Vercel supports these parts of the rollout:
Company sign-in for team access with SAML SSO: Require a SAML-authenticated session to access team information on Enterprise or with the paid Pro add-on.
Team membership updates with Directory Sync: On Enterprise, invite and remove team members as the connected directory changes.
Company sign-in for internal deployments with Vercel Passport: On Enterprise, authenticate visitors through your identity provider before they can view a protected deployment.
Temporary cloud credentials with OIDC federation: Exchange workload tokens from builds and Vercel Functions for credentials from a cloud provider you’ve configured to trust them.
Private previews with Deployment Protection: On any plan, use Standard Protection with Vercel Authentication to restrict access to previews.
Start a new project and require SAML SSO for your team, or browse templates for an app to put behind single sign-on.
Copy link to headingFrequently asked questions about SAML vs OIDC
Copy link to headingDoes Okta use SAML or OIDC?
Both. In Okta's App Integration Wizard, admins choose SAML 2.0 or OIDC for each custom app integration.
Copy link to headingDoes SAML use JWT?
No. SAML assertions use XML. RFC 7522 defines how a client can use a SAML assertion as an authorization grant at a compatible OAuth token endpoint. The resulting access token doesn't have to be a JWT.
Copy link to headingDoes SCIM replace SAML or OIDC?
No. The System for Cross-domain Identity Management (SCIM) protocol provides an HTTP API for managing user and group records. Use SAML or OIDC for sign-in, and plan provisioning and deactivation separately. Check whether deactivating an account also ends its active app sessions.
Copy link to headingShould an API accept an OIDC ID token?
No. An OIDC ID token is for the client app. For a protected API, use an access token issued for that API and check that it permits the requested operation. For a workload, use the credential flow the target service supports and limit access to what the job needs.