API reference
Sign in with Pinal
OAuth 2.1 and OpenID Connect on Pinal Accounts: send people to sign in, get tokens, find out who they are.
Base URL https://accounts.pinal.tech
API reference
OAuth 2.1 and OpenID Connect on Pinal Accounts: send people to sign in, get tokens, find out who they are.
Base URL https://accounts.pinal.tech
/.well-known/openid-configurationOpenID Connect discovery metadata: every endpoint, supported scope, grant and signing algorithm. Point your OIDC library here and it configures itself.
curl "https://accounts.pinal.tech/.well-known/openid-configuration"{
"issuer": "https://accounts.pinal.tech",
"authorization_endpoint": "https://accounts.pinal.tech/api/auth/oauth2/authorize",
"token_endpoint": "https://accounts.pinal.tech/api/auth/oauth2/token",
"userinfo_endpoint": "https://accounts.pinal.tech/api/auth/oauth2/userinfo",
"jwks_uri": "https://accounts.pinal.tech/api/auth/jwks",
"code_challenge_methods_supported": [
"S256"
]
}/api/auth/oauth2/authorizeSend the person's browser here. They sign in to Pinal Accounts (if they aren't already), see your app's consent screen, and come back to redirect_uri with a code and your state. PKCE (S256) is required for every app.
response_type string requiredAlways code.
One of code
client_id string requiredYour app's client ID.
redirect_uri string requiredOne of your app's redirect URIs, exactly as registered.
scope string requiredSpace-separated scopes. Must be a subset of the scopes your app is allowed.
state string requiredAn unguessable value you check when the person comes back.
code_challenge string requiredBASE64URL(SHA256(code_verifier)).
code_challenge_method string requiredAlways S256.
One of S256
nonce string Echoed in the ID token, to bind it to this sign-in.
prompt string login to force a fresh sign-in, consent to show the consent screen again.
One of loginconsentselect_account
curl "https://accounts.pinal.tech/api/auth/oauth2/authorize?response_type=%7Bresponse_type%7D&client_id=pnl_7Hq2xV9kLmA1&redirect_uri=%7Bredirect_uri%7D&scope=openid%20profile%20email&state=%7Bstate%7D&code_challenge=%7Bcode_challenge%7D&code_challenge_method=%7Bcode_challenge_method%7D"/api/auth/oauth2/tokenExchange an authorization code (or a refresh token) for tokens. Confidential apps authenticate with HTTP Basic (client_id:client_secret); public apps send client_id and rely on PKCE.
grant_type string required One of authorization_code refresh_token
code string From the redirect (authorization_code).
redirect_uri string Same value as in the authorize request.
code_verifier string The PKCE verifier.
refresh_token string For grant_type=refresh_token.
client_id string Public clients only; confidential clients use HTTP Basic.
curl -X POST "https://accounts.pinal.tech/api/auth/oauth2/token" \
-d grant_type=authorization_code \
-d code=Sx8Qm… \
-d redirect_uri=https://example.com/auth/callback \
-d code_verifier=dBjftJeZ4CVP…{
"access_token": "eyJhbGciOi…",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "rt_9c1…",
"id_token": "eyJhbGciOi…",
"scope": "openid profile email"
}/api/auth/oauth2/userinfoClaims about the person, limited to the scopes they granted: sub always; name and picture with profile; email and email_verified with email.
curl "https://accounts.pinal.tech/api/auth/oauth2/userinfo" \
-H "Authorization: Bearer $ACCESS_TOKEN"{
"sub": "usr_2k9d",
"name": "Alex Rivera",
"email": "alex@pinal.email",
"email_verified": true,
"picture": "https://accounts.pinal.tech/avatars/usr_2k9d.png"
}/api/auth/oauth2/revokeRevoke an access or refresh token, e.g. when someone disconnects inside your app. Revoking a refresh token also ends the access tokens issued from it.
token string required token_type_hint string One of access_token refresh_token
curl -X POST "https://accounts.pinal.tech/api/auth/oauth2/revoke" \
-d token=string \
-d token_type_hint=access_token/api/auth/oauth2/end-sessionRP-initiated logout. Ends the person's Pinal session and returns them to one of your sign-out redirect URIs.
id_token_hint string The ID token you received at sign-in.
client_id string Your client ID.
post_logout_redirect_uri string One of your registered sign-out redirect URIs.
state string Echoed back.
curl "https://accounts.pinal.tech/api/auth/oauth2/end-session"/api/auth/jwksPublic keys (JWKS) for verifying ID tokens and JWT access tokens.
curl "https://accounts.pinal.tech/api/auth/jwks"{}