On this page
Single sign-on (SSO)
Patrii Cloud can act as an OpenID Connect (OIDC) and OAuth2 identity provider, so you can sign in to other applications with your Patrii Cloud account and connect integrations securely.
When Patrii Cloud is your identity provider, your users authenticate once against Patrii Cloud and your application receives standard tokens describing who they are. There is no separate password to manage in each app.
The implementation follows the OpenID Connect and OAuth2 standards, so it works with common identity libraries out of the box. Your app reads the discovery document to learn the authorize, token, userinfo and key endpoints, and validates tokens against the published keys.
Key concepts
Identity provider (IdP) — The service that authenticates users and issues tokens; here, Patrii Cloud.
OpenID Connect — An identity layer on top of OAuth2 that returns a verifiable ID token about the user.
Discovery document — A well-known URL that lists all the OIDC endpoints and settings for automatic configuration.
Consent screen — The page where a user approves an application's request to use their identity.
JWKS — The published set of public keys your app uses to verify the signature on issued tokens.
Before you start
- An application that supports OpenID Connect or OAuth2.
- The client credentials Patrii Cloud issues for your application.
- A redirect URL in your application to receive the sign-in result.
Step by step
- Read the discovery document
Point your app at the OIDC discovery URL to auto-configure the authorize, token, userinfo and JWKS endpoints.
- Configure your application
- Set your client credentials and redirect URL.
- Request the scopes your app needs (for example openid, profile, email).
- Send users to sign in
Redirect users to the authorization endpoint; they authenticate with Patrii Cloud and approve the consent screen.
Screenshot — A user approving the consent screenA user approving the consent screen - Exchange the code for tokens
Your app exchanges the returned authorization code at the token endpoint for an ID token and access token.
- Read the user and verify tokens
Call the userinfo endpoint for profile details, and validate token signatures against the JWKS keys.
Examples
curl https://api.patrii.cloud/oauth2/.well-known/openid-configuration
curl https://api.patrii.cloud/oauth2/jwks
curl -H "Authorization: Bearer $ACCESS_TOKEN" \ https://api.patrii.cloud/oauth2/userinfo
Limits & specifications
Standard OIDC / OAuth2 endpoints:
| Endpoint | Purpose |
|---|---|
/oauth2/.well-known/openid-configuration | Discovery document listing all endpoints. |
/oauth2/authorize | Where users sign in and grant consent. |
/oauth2/token | Exchange the authorization code for tokens. |
/oauth2/userinfo | Return the authenticated user's profile. |
/oauth2/jwks | Public keys used to verify token signatures. |
Best practices
- Use the discovery document instead of hard-coding endpoints so your app keeps working if they change.
- Request only the scopes your application actually needs.
- Always validate token signatures against the JWKS keys before trusting a token.
- Keep your client secret confidential and out of source control.
FAQ
Which standards does Patrii Cloud support?
How does my app learn the endpoints?
Can I automate the API without a browser sign-in?
Learn more
Everything you can do here in the console is also available through the Patrii Cloud API for automation and scripting.