User login (OpenID Connect)

Prev Next
Post
/identity/users/openIdLogin

Authenticates the user in the DPS through the OpenID Connect plugin.
Generally, this endpoint is called on return from the OpenID provider's authentication page. The code, state, and redirectUrl values obtained from that redirect must be provided in the payload.

Alternatively, if you already have an OpenID access token, you can log in directly by supplying the accessToken field instead. In this case the code, state, and redirectUrl fields are not required: the backend validates the access token against the User Info URL configured in the OpenID Connect plugin. If the user's identity is verified, a new token for the DPS APIs will be provided. Note that the OpenID access token is different from the token returned by this endpoint, which is the one required to make authenticated requests to the DPS backend.

Header parameters
X-Servitly-Tenant
stringRequired

The name of the tenant (e.g. acme).

Query parameters
apiKey
stringRequired

The API KEY identifying the client.

Example{{apiKey}}
Body parameters

The OpenID login payload.

Expand All
object

The payload message for login requests based on OpenID.
The code, state, and redirectUrl fields are required when accessToken is not present.

code
string

Single-use short-lived authorization code returned by the OpenID provider; exchange it at the token endpoint for access tokens.

Example5/0AXEQxICstBm11XBunObzgYsIq8SF.......
state
string

Opaque anti-CSRF value returned unchanged by the OpenID provider; must match the value stored for the session.

Examplefacf1893-469f-488f-8ec3-a424f0056964
redirectUrl
string

Callback URL where the OpenID provider redirects after authentication with the code and state; must match a pre-registered redirect URI.

Examplehttps://acme.servitly.com/open-id
accessToken
string

The access token obtained by the OpenID provider to be used for direct login.
This field is mutually exclusive with code, state, and redirectUrl.

Examplexa42.a0ARGnu0ZXhjGlZdRr3Ubg......
devices
Array of object | null
object

Details about the device on which the API client is currently running.

deviceId
string

The unique identifier which is used to match the device among different logins.

appId
string

The identifier/package-name of the mobile app used to log in (e.g. com.acme.mobile).

os
string

The device operating system.

ExampleAndroid_9, iOS_11
model
string

The mobile device model.

ExamplePixel 10
platform
string

The mobile platform name.

Valid values[ "Android", "iOS" ]
browser
string

The information of the browser (navigator.userAgent) used to access the DPS.

notificationDeviceId
string

The device notification identifier obtained from the platform provider during the device registration for notifications.

Responses
200

Authentication succeeded.

object

The response message for login requests.

token
string

The JWT token to include as the bearer token in authenticated requests.

Example661fd29342541977c4002ec7...
tokenExpirationTimestamp
integer (int64)

The timestamp when the token will expire and must be refreshed.
Generally one hour after issuance, but this may vary over time.

Example1578438000000
refreshToken
string

The refresh token used to request a new JWT token when the current one expires.

Examplecd2bd3a0-861d-4798-8fd6-2a2a99fb92e8
userId
string

The id of the authenticated user.

Example6616689a0de6d87b47cd6308
tenantId
string

The id of the tenant.

Example661533a57bba156cf6e8d04b
401

Invalid credentials, user not authenticated.

object
message
string

The error response.

ExampleInvalid credentials
500

Internal server error.

object
message
string

The error response.

ExampleInternal Server Error