Complete authentication by OpenID Connect
POST/auth/user/oidc
Base URL: https://api.tinkermode.com
If a project has added alternative user authentication methods that support OpenID Connect, its frontend app should use this set of endpoints to handle the authentication flow. This endpoint is for completing the process when a user has been redirected back from an Identity Provider after they have consented to share information with MODE. The frontend app should extract the state and code from the URL and call this endpoint to validate the code and obtain a client authentication token.
Authentication
This endpoint does not require authentication.
Request body
Content type: application/x-www-form-urlencoded
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
appId | string | Yes | ID of the app the user is using. | |
code | string | Yes | Authorization code embedded in the URL redirected from the Identity Provider after the user has consented to share information with MODE. | |
methodId | string | Yes | ID of the project's User Authentication Method that is being used. | |
projectId | integer | Yes | ID of project to which the user belongs. | |
redirectUrl | string | Yes | The same redirect URL that was used to obtain the authorization URL. It is needed by the Identity Provider to verify the authorization code. |
Request example
appId=webapp&code=XXXXXXX&methodId=google&projectId=1260&redirectUrl=https%3A%2F%2Fexample.com%2Fsign_inResponses
200 User has been successfully authenticated.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
auth2FToken | string | No | read-only (server-generated) | Token used for completing the two-factor authentication process. Token will expire within 3 minutes |
expirationTime | string | No | read-only (server-generated); format: date-time | This property is present if token has an expiration time. |
sudoer | string | No | read-only (server-generated) | This property is present if client is authenticated via sudo. |
token | string | No | read-only (server-generated) | Access token to be used in the HTTP Authorization header in future API requests. |
userId | integer | No | read-only (server-generated) | This property is present if token is associated with a user. |
401 Authorization is required to access this resource.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
403 Request failed because of invalid data or denied permission.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
429 Request failed because of rate limit.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
500 An unexpected error has occurred.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |
503 The service is temporarily unavailable.
Content type: application/json
| Property | Type | Required | Constraints | Description |
|---|---|---|---|---|
data | object | No | read-only (server-generated) | Any relevant data related to error. |
reason | string | Yes | read-only (server-generated) | Reason of error. |