/api/apps/{app_id}/authorizeAuthenticatedAuthorize a client application
Records the caller's consent for a client application to receive tokens on their behalf, and for the API scopes they approved (approved_api_scopes, among those the request's scope asks for of the API server its resource names). Idempotent; consenting again adds scopes, never removes them. The auth server's own app is always authorized and cannot be explicitly authorized (403). The JSON body is optional.
post_api_apps_app_id_authorizeClient applicationsAuthentication & permissionsAuthenticated
Any authenticated user
- Accepted credentials
- Auth server session (refresh token cookie)
cookie "refresh_token_<auth_server_app_id>" - Access token (cookie)
cookie "access_token_<auth_server_app_id>" - Access token (Bearer)
Authorization: Bearer <JWT>
- Auth server session (refresh token cookie)
- Who may call
- Any authenticated user
Path parameters
| Name | Type | Description |
|---|---|---|
| app_id* | string | Client application id |
Request body
Optional — Optional; unknown fields are rejected.
| Property | Type | Description |
|---|---|---|
| state | string | The OAuth2 minLength: 1maxLength: 512pattern: ^[\x20-\x7E]+$ |
| scope | string | The authorization request's requested scopes. Required for minLength: 1maxLength: 1024pattern: ^[\x21\x23-\x5B\x5D-\x7E]+(?: [\x21\x23-\x5B\x5D-\x7E]+)*$ |
| resource | string | The authorization request's RFC 8707 resource indicator, whose API scopes minLength: 1maxLength: 2048 |
| approved_api_scopes | string[] | The API scopes the user approved on the consent screen. Recorded as the user's consent for those of them the request asks for and the app may be granted; the rest are ignored. Omitted or empty: no API scope is consented (the app is still authorized). maxItems: 100 |
Responses
| Property | Type | Description |
|---|---|---|
| success* | true | |
| message* | string | |
| resource_id* | string | Identifier of the created / affected resource |
Example request
curl -X POST 'https://auth.schemavaults.com/api/apps/<app_id>/authorize' \
-b 'refresh_token_<auth_server_app_id>=<value>' \
-H 'Content-Type: application/json' \
-d '{
"state": "string",
"scope": "string",
"resource": "string",
"approved_api_scopes": [
"string"
]
}'