Guides & concepts
Choose the right identity flow.
Egreed ID supports authorization_code with PKCE, refresh_token, and client_credentials. Use discovery to configure a standards-compliant library, then request only the scopes your integration needs.
OAuth 2.1 and OpenID Connect
Point your OAuth 2.1 or OIDC client library at the discovery document. It publishes the authorization, token, UserInfo, JWKS, introspection, and revocation endpoints.
https://id.egreedtech.org/.well-known/openid-configuration| Grant | Use |
|---|---|
| authorization_code + PKCE | Interactive sign-in for web, mobile, and browser applications. |
| refresh_token | Renew access without asking the user to sign in again. |
| client_credentials | Machine-to-machine access where no end user participates. |
Authorization code with PKCE
- 1. Create a verifier. Generate a cryptographically random value and derive its S256 challenge.
- 2. Authorize. Send the challenge, client ID, redirect URI, state, and scopes to
/oauth/authorize. - 3. Validate callback. Compare the returned state before accepting the code.
- 4. Exchange. Send the code and original verifier to the token endpoint.
Refresh token rotation
Request offline_access for a refresh token. Replace the stored refresh token after every successful exchange. The previous token becomes invalid immediately; reuse revokes the complete chain.
curl -X POST https://id.egreedtech.org/api/public/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=refresh_token" \
-d "refresh_token=ROTATING_REFRESH_TOKEN" \
-d "client_id=egr_client_..."Server-to-server integrations
Use scoped API keys or client credentials from your backend only. Never embed a key in browser or mobile code. Every request is checked against the credential's scope and expiry, and out-of-scope access is rejected with HTTP 403 and recorded in the integration access log.
curl https://id.egreedtech.org/api/public/v1/me \
-H "Authorization: Bearer egr_live_..." \
-H "Accept: application/json"
# API keys also support:
# -H "X-API-Key: egr_live_..."SDK and library guidance
Use a maintained OAuth 2.1 / OpenID Connect library for your language and configure it with Egreed ID's discovery URL. Confirm the library supports authorization code with S256 PKCE, RS256 validation through JWKS, state and nonce checks, refresh-token rotation, and exact redirect URI matching.