Complete an OIDC login: exchange the code, validate the ID token, map IdP groups to a role, JIT-provision the account, and issue a Yagra session.
const url = 'https://example.com/api/v1/auth/oidc/callback';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"code":"example","state":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/auth/oidc/callback \ --header 'Content-Type: application/json' \ --data '{ "code": "example", "state": "example" }'Authorizations
Section titled “Authorizations”- None
Request Bodyrequired
Section titled “Request Bodyrequired”OIDC callback body: the code + state the WebUI forwards from the IdP redirect.
object
Examplegenerated
{ "code": "example", "state": "example"}Responses
Section titled “Responses”A Yagra session for the SSO account
A session minted by a completed SSO login — the same shape local login returns, deliberately, so the WebUI stores a token the same way whichever path produced it.
object
Predefined roles, ordered least → most privileged.
Example
{ "role": "viewer"}The login could not be completed; which step failed stays server-side
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}No OIDC provider store, no provider enabled, or skeleton mode
The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI
document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies
undescribed — a client that has to guess the failure shape ends up parsing the success shape and
reading undefined.
object
object
Stable machine-readable code. Clients branch on this, never on the message.
Operator-facing sentence. Safe to display; never carries an internal error’s own text.
Examplegenerated
{ "error": { "code": "example", "message": "example" }}