Go, ASP.NET, PHP and other backends
There is no dedicated YeboID SDK for these languages in this release. Use an existing OAuth/OIDC client in the application's framework, or generate a wire client from openapi.json. A generated HTTP client does not implement browser-session security or API authorization for you. The platform manifest identifies the available maintained packages.
Sign-in contract
- Read OIDC discovery, require the configured issuer exactly, and require HTTPS endpoints. The authorization endpoint can have a different origin than the issuer.
- Bind a cryptographically random
stateand S256 PKCE verifier to an encrypted server-side browser session. Use an exact registered callback. Requestresponse_type=codeand explicit registered scopes, includingopenid. Send the browser to the discovered authorization endpoint. - On callback, atomically consume the pending transaction, verify the exact route, state and a short transaction lifetime, reject duplicate query parameters, and surface denial. Do not exchange a code before these checks.
- POST a form-encoded authorization-code exchange to the discovered token endpoint. Supply
client_id, exactredirect_uri,codeandcode_verifier; supplyclient_secretonly from a confidential server environment. Do not default to HTTP Basic auth: discovery advertisesclient_secret_postandnone. - Persist tokens in encrypted server-side session storage. Fetch profile claims from userinfo using the access token. Store only
subasyeboid_user_idin the product DB.
Protect an API using current token state
Use POST /oauth/introspect with a form body. This works from Go's HTTP client, .NET HttpClient, PHP's HTTP client, or another framework without inventing a local JWT parser:
POST /oauth/introspect HTTP/1.1
Host: api.yeboid.com
Content-Type: application/x-www-form-urlencoded
client_id=YOUR_CLIENT_ID&token=ACCESS_TOKEN&token_type_hint=access_tokenA confidential server may also send client_secret in that form. Never print this request body in logs.
Accept the result only when all these conditions hold:
- HTTP success with a well-formed object,
activeis the booleantrue. client_idis exactly the client used by your frontend and API.token_typeisBearer(case-insensitive). Active refresh-token introspection has no Bearer token type; it must not authorize an API.subis a nonempty string and numericexpis finite and in the future.- Required scopes are present in the returned space-separated
scopestring.
Afterward, check resource ownership in the product API. Return 401 for inactive/invalid tokens, 403 for insufficient permissions, and a normal 5xx error for dependency/network/malformed-response failures. Do not treat an unavailable introspection endpoint as inactive or anonymous success. Use a bounded timeout, reject redirects, and do not automatically retry rotating-token exchanges.
For offline verification, use a maintained JWT library and the discovered JWKS. Require RS256, issuer, audience, expiry, YeboID token-purpose claim type: access, and the actual access-token scopes array. The JWT scopes array differs from the OAuth/introspection wire scope string. ID tokens must not authenticate product API calls. Offline verification cannot see revocation until expiry.
Refresh and sign-out
Serialize the read → refresh → durable-write sequence per session across all server workers. A refresh uses grant_type=refresh_token, client_id and the current refresh_token; omit scope to avoid expanding consent. Persist the rotated refresh token before releasing the lock. If the request result or storage is uncertain, require a new login rather than replaying the old token.
Revoke the current refresh token using /oauth/revoke, then clear the product session only after success. This does not clear the browser SSO cookie or instantly invalidate access JWTs for offline verifiers.
See agent acceptance checks and tokens. Do not claim a dedicated package or a live login until its source/distribution and actual behavior have been verified.