Finish a native sign-in
const url = 'http://127.0.0.1:8080/api/v1/auth/native-sessions';const options = { method: 'POST', headers: { Origin: 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"code":"example","code_verifier":"example","redirect_uri":"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 http://127.0.0.1:8080/api/v1/auth/native-sessions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Origin: example' \ --data '{ "code": "example", "code_verifier": "example", "redirect_uri": "example" }'Available only when account authentication is enabled. Provider configuration is restart-bound. Local logout does not require an external provider. Responses must not be cached.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The one-time code from the return target. It expires after one minute and is consumed by the first attempt.
The PKCE verifier: 43 to 128 unreserved characters.
The return target used to begin the sign-in.
Examplegenerated
{ "code": "example", "code_verifier": "example", "redirect_uri": "example"}Responses
Section titled “Responses”The one-time code and its PKCE verifier are exchanged for an ordinary session, returned in the instance’s session cookie. A presented earlier session is revoked.
object
object
Examplegenerated
{ "csrf_token": "example", "invitation_accepted": true, "user": { "display_name": "example", "id": "example", "instance_admin": true }}Structured authentication boundary failure
object
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}Structured authentication boundary failure
object
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}Structured authentication boundary failure
object
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}Structured authentication boundary failure
object
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}Structured authentication boundary failure
object
Examplegenerated
{ "code": "example", "detail": "example", "status": 1, "title": "example", "type": "example"}