Completes a login: validates the callback, exchanges the code, resolves
GET
/auth/callback
curl --request GET \ --url http://localhost:3001/auth/callback \ --header 'Authorization: Bearer <token>'import requests
url = "http://localhost:3001/auth/callback"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.status_code)use reqwest;
#[tokio::main]pub async fn main() { let url = "http://localhost:3001/auth/callback";
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap());
let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await;
let status = response.unwrap().status();
dbg!(status);}(or provisions) the principal, and mints a session.
Every failure path here ends in a clean ApiError and no session:
a provider error, a missing/expired flow cookie, a state mismatch, an
exchange/token failure, ClaimRejected, and SubjectNotAvailable (the
latter two both map to 403 — see ResolveOutcome) all return before
create_session is ever called.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”code
required
string
state
required
string
error
required
string
Responses
Section titled “Responses”Login completed; session cookie set, redirects to the validated return_to (default /)
Malformed callback, or a missing/expired/mismatched login flow
The provider rejected the login, or the exchanged token failed verification
The claim gate rejected the identity, or the subject belongs to a non-human or disabled principal
The identity provider was unreachable