---
title: "Complete SSO Authentication (IdP Callback)"
method: POST
path: "/v2/authn/sso/login-callback"
tags: ["SSO Authentication"]
---

# Complete SSO Authentication (IdP Callback)

`POST /v2/authn/sso/login-callback`

## Request

- Base URL: `https://api.alianza.com`
- URL: `https://api.alianza.com/v2/authn/sso/login-callback`
- Auth: API key in header `X-AUTH-TOKEN`
- TypeScript: <https://skmtc.dev/alianza/apis/alianza-public-api/docs/v2/authn/sso/login-callback/post.ts> (a function with typed inputs; its response is checked against the schema)

Completes the SSO authentication flow after the user has authenticated with their Identity Provider.

Flow:
1. User authenticates at the IdP
2. IdP sends SAML assertion to Auth0
3. Auth0 exchanges it for an authorization code
4. This endpoint receives the code and exchanges it for user tokens
5. Returns a LoginTokenX object for authenticated API use

## Query parameters

- `code` string, required
- `redirect_uri` string, uri, required
- `state` 'ACCOUNT_LEVEL_SSO' | 'PARTITION_ENFORCED_SSO' | 'PARTITION_SSO', required

## Response `200`

Authentication successful

- LoginTokenX
  - `authToken` string
  - `userId` string
  - `userType` 'AccountUser' | 'EndUser' | 'ManagementUser' | 'AlianzaUser' | 'BusinessLines'
  - `endUserType` 'ADMIN' | 'ADVANCED_ADMIN' | 'BASIC_ADMIN' | 'STANDARD' | 'STANDARD_ADMIN' | 'SUPER_ADMIN'
  - `username` string
  - `firstName` string
  - `lastName` string
  - `emailAddress` string
  - `partitionId` string
  - `partitionName` string
  - `accountId` string
  - `permissions` object
  - `featureToggles` object
  - `mustChangePassword` boolean
  - `subPartitionIds` string[]
  - `tokenSource` string
  - `grantedAuthorities` string[]
  - `pwdHash` string
  - `mustAddEmail` boolean
  - `maxLifeInHours` integer
  - `groupId` string
  - `groupName` string

## Other responses

- `400`: Bad Request - Invalid or malformed parameters
- `401`: Authentication failed - Invalid state or code verification failed
- `404`: State not found or session expired

---

[API](https://skmtc.dev/alianza/apis/alianza-public-api.md) - [All operations](https://skmtc.dev/alianza/apis/alianza-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/alianza/apis/alianza-public-api/revisions/7223246c352c?raw)
