Complete OAuth2 identity linking
POST
/_torii/users/me/identities/oauth2/complete
const url = 'https://your-app.toriiauth.eu/_torii/users/me/identities/oauth2/complete';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"token":"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://your-app.toriiauth.eu/_torii/users/me/identities/oauth2/complete \ --header 'Content-Type: application/json' \ --data '{ "token": "example" }'Attaches the provider identity parked by a linking flow started with completion: "sdk" to the signed-in user. The token arrives as the #__torii_link_pending redirect fragment. Only the user who started the link can complete it; every miss answers the same 400.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
token
required
Token from the #__torii_link_pending redirect fragment.
string
Examplegenerated
{ "token": "example"}Responses
Section titled “Responses”OK
Media typeapplication/json
object
id
required
string format: uuid
protocol
required
string
issuer
required
string
subject
required
string
label
string | null
status
required
string
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
Example
{ "protocol": "email", "status": "active"}invalid_request: unknown, expired, consumed or foreign token
Media typeapplication/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Examplegenerated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }}identity_already_linked: the provider identity belongs to another user
Media typeapplication/problem+json
object
type
string format: uri
title
string
status
integer format: int32
detail
string
instance
string format: uri
properties
object
key
additional properties
Examplegenerated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "https://example.com", "properties": { "additionalProperty": "example" }}