Appearance
Start login
Starts a sign-in and returns the address the user should open.
POST /fieldservicegateway/usermanagement/v3/oauth/login/init
Request
| Field | Type | Required | Description |
|---|---|---|---|
app_client_id | string | yes | Application client id |
redirect_uri | string | yes | Address registered for this client. The user returns here after sign-in |
state | string | yes | Value you create to match the callback to this request. At least 8 characters |
scope | string | no | Defaults to openid profile email |
email | string | no | Hint for the login screen |
domain | string | no | Single sign-on provider, such as Asurion_SSO |
code_challenge | string | with method | PKCE challenge, 43–128 characters |
code_challenge_method | string | with challenge | S256. Send both PKCE fields, or neither |
Example
json
{
"app_client_id": "app-client",
"redirect_uri": "https://example.com/callback",
"state": "state-value-1",
"code_challenge": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR",
"code_challenge_method": "S256"
}cURL
bash
curl --request POST 'https://[BASE_URL]/fieldservicegateway/usermanagement/v3/oauth/login/init' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {{x-api-key}}' \
--header 'Authorization: {{Authorization}}' \
--header 'Asurion-correlationid: correlation-id' \
--header 'Asurion-enduser: end-user' \
--header 'Asurion-sourcesystem: source-system' \
--header 'Asurion-serviceprovider: company-id' \
--header 'Asurion-client: default' \
--data '{
"app_client_id": "app-client",
"redirect_uri": "https://example.com/callback",
"state": "state-value-1",
"code_challenge": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR",
"code_challenge_method": "S256"
}'Response
200 OK
json
{
"success": true,
"data": {
"authorization_url": "https://example.com/oauth/authorize?state=state-value-1"
}
}Open authorization_url in the browser. After sign-in, exchange the returned code with Login authorize.
Errors
| Status | Code | When |
|---|---|---|
| 400 | VALIDATION_ERROR | A required field is missing, or PKCE fields do not match |
| 500 | INTERNAL_ERROR | Something unexpected failed |