Description
You have to call this method when you want to log in an user at DRUID, but user need to accept new Terms & Conditions. Normally first, you had call the login service, and receive a response that indicates that user needs to accept new Terms & Conditions (in the response you will receive number of assertions to accept and text of each).
Please, read first: https://dru-id.com/developers/apis/oauth-2/ to learn about Oauth2 protocol and the meaning of each token.
Endpoint URL:
POST https://{your-endpoint-domain.com}/activityid/v1/assertions/accept
Request parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
| Authorization | “Bearer app_token” Literal text Bearer followed by app_token that is the token obtained from /oauth2/token endpoint | string | yes |
| Content-Type | The type of content that will be used for requests to be JSON | string | yes |
| Accept | The type of content that will be used for responses to be JSON | string | yes |
| From | Name of the entry point | string | yes |
| Accept-Language | Language of this request | Locale | no |
Request example
| Parameter | Description | Type | Required | Value |
|---|---|---|---|---|
| actor.id | app_id of the application you are using to log user | string | yes | app id |
| actor.objectType | Type of the object which represents the actor | string | yes | ‘application’ |
| verb | Verb used for the login | string | yes | ‘accept’ |
| object.objectType | ObjectType represents the user | string | yes | ‘user’ |
| object.password | Password of the user. it must be send plain | string | yes | user password |
| object.ids | User identifiers. More info about user identifiers User Info | struct | yes | struct |
| object.assertions | Struct that defines legalities manage by the user. More info about user assertions User Info | struct | yes | struct |
| source.id | Type of device doing the activity | string | yes | ‘unknown’ | ‘pc’ | ‘mobile’ | ‘tablet’ | ‘game_console’ | ‘itv’ |
| source.objectType | Type of source | string | yes | ‘device’ |
Response examples
Response: user logged
| Parameter | Description | Type |
|---|---|---|
| content | Data receive with the response | struct |
| content.user | Data of the user logged with the request. More info about user struct at User Info | struct |
| content.access_token | access token | string |
| result.status | HTTP status code | integer |
Response KO: Terms & Conditions not approved by the user
| Parameter | Description | Type |
|---|---|---|
| content | Data receive with the response | struct |
| content.assertions | List of assertions not completed by the user | array |
| content.assertions.objectType | ObjectType represents the assertions list | ‘assertions’ |
| content.assertions.items | List of assertions. More info about assertions at User Info | array |
| result.status | HTTP status code | int |
| errors.message | Errors description | string |
Response codes
| Code | Type | Description |
|---|---|---|
| 400 | Error | Bad Request: The request could not be understood by the server due to malformed syntax |
| 401 | Error | Unauthorized: authentication is required and has failed or has not yet been provided (token is invalid, etc) |
| 403 | Error | Forbidden: user id or password are invalid |
| 428 | Error | Precondition required: User need to configure MFA or needs to send a MFA code. Check the MFA API |
| 451 | Error | Unavailable For Legal Reasons: user must accept new terms and conditions |
| 500 | Error | Internal Server Error: The server encountered an unexpected condition which prevented it from fulfilling the request |
| 504 | Error | Gateway TimeoutService can not contact with oauth server to do some internal operations |
| 200 | Sucess | User accept t&c conditions and logged successfully. You will get ‘user logged JSON response’ |
