opauth's redirect back after a sign-in (OIDC callback).
const url = 'https://api.opdns.io/v1/auth/oidc/callback';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.opdns.io/v1/auth/oidc/callbackThe OIDC redirect URI registered at opauth. The API compares the state with
the sealed cookie that startSignIn set. It exchanges the code at the opauth
token endpoint with a private_key_jwt client assertion. It makes sure that
the ID token is correct (issuer, audience, signature against the opauth JWKS,
nonce). Then it finds the opdns account by its op account subject, or links
the account whose address is the verified address of the ID token, or creates
an account. It refuses to create one when signup is closed, or when signup is
invite-only and the address is not on the allowlist. It starts an opdns session
(the session cookie) and remembers the op sign-in session (sid), so the
opauth sessions.revoked events end it. Then it redirects to the return_to
of the start. A failure redirects to the dashboard with ?auth_error=<code>
(oidc_failed, signup_closed, invite_required, email_conflict,
access_denied, account_locked).
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”The authorization code.
The state sent by the start.
An OAuth error from opauth.
The error’s description.
The issuer (RFC 9207). It must be the opauth issuer.
Responses
Section titled “Responses”Signed in (or refused). Redirects to the dashboard.
Headers
Section titled “Headers”Where the browser goes next.
Rate limited (rate_limited). For an API token, the organization used all of the rate of its plan until RateLimit-Reset.
object
Stable machine code.
object
Seconds, the same value as the Retry-After header (rate limits, offline nodes).
The plan limit that a plan_limit problem reached.
object
The value of the limit in the plan.
Where to change to a larger plan.
The scope that the API token did not have (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/rate_limited", "title": "Too Many Requests", "status": 429, "code": "rate_limited", "detail": "You sent too many requests in a short time. Wait a moment, then try again.", "request_id": "5f2c9a0e7b1d4c38", "retry_after": 6}Headers
Section titled “Headers”On every response to an API token: the rate of the plan of the organization, in requests per one-minute window (api_requests_per_minute).
On every response to an API token: the requests left to the organization in the current window.
On every response to an API token: the seconds until the current window ends and the count resets.
On every response to an API token: the quota policy, <limit>;w=60.
oidc_unavailable: this server has no opauth client configured, or the API cannot reach opauth.
object
Stable machine code.
object
Seconds, the same value as the Retry-After header (rate limits, offline nodes).
The plan limit that a plan_limit problem reached.
object
The value of the limit in the plan.
Where to change to a larger plan.
The scope that the API token did not have (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/oidc_unavailable", "title": "Service Unavailable", "status": 503, "code": "oidc_unavailable", "detail": "We did not start your sign-in because our sign-in service does not respond. The problem is not with your op account. Try again in a minute."}