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

PropertyTypeRequiredConstraintsDescription
appIdstringYesID of the app the user is using.
codestringYesAuthorization code embedded in the URL redirected from the Identity Provider after the user has consented to share information with MODE.
methodIdstringYesID of the project's User Authentication Method that is being used.
projectIdintegerYesID of project to which the user belongs.
redirectUrlstringYesThe 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_in

Responses

200 User has been successfully authenticated.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
auth2FTokenstringNoread-only (server-generated)Token used for completing the two-factor authentication process. Token will expire within 3 minutes
expirationTimestringNoread-only (server-generated); format: date-timeThis property is present if token has an expiration time.
sudoerstringNoread-only (server-generated)This property is present if client is authenticated via sudo.
tokenstringNoread-only (server-generated)Access token to be used in the HTTP Authorization header in future API requests.
userIdintegerNoread-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

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

403 Request failed because of invalid data or denied permission.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

429 Request failed because of rate limit.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

500 An unexpected error has occurred.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.

503 The service is temporarily unavailable.

Content type: application/json

PropertyTypeRequiredConstraintsDescription
dataobjectNoread-only (server-generated)Any relevant data related to error.
reasonstringYesread-only (server-generated)Reason of error.