Resource Owner Password Credentials Flow
This flow can be used for a client that accesses resources on behalf of a user (resource owner) which credentials the client knows. The client can be, for example, a device operating system or a highly privileged application.
The client should be capable of obtaining the resource owner's credentials — username and password, typically via an interactive form.
The client should be registered with Space as Service Account or Mobile or Desktop App.
The client should make a request to the token endpoint
<Space service URL>/oauth/token by adding the following parameters to the entity-body of HTTP request in the
application/x-www-form-urlencoded format with UTF-8 character encoding:
To obtain an access token from Space, your client needs to provide values for the following parameters in authorization requests:
|Required. Specifies the grant type in an OAuth 2.0 request. Set value to |
|Required. The resource owner username.|
|Required. The resource owner password.|
|The private identifier assigned to your client application when you register it in Space. To get the client secret, go toand choose your client from the list.|
Required. A space separated list of rights required to access specific resources in Space.
The rights are grouped in four categories: Global, Profile, Team, Project. Use the following syntax to specify the rights (shown here in BNF notation):
<SCOPE> ::= <ALL> | <TOKEN_LIST> <ALL> ::= '**' <TOKEN_LIST> ::= <TOKEN> (' ' <TOKEN>)* <TOKEN> ::= <GLOBAL_PERMISSIONS_TOKEN> | <ENTITY_PERMISSIONS_TOKEN> <GLOBAL_PERMISSIONS_TOKEN> ::= <PERMISSIONS> <ENTITY_PERMISSIONS_TOKEN> ::= <ENTITY> ':' <PERMISSIONS> <ENTITY> ::= 'Team' | 'Project' | 'Profile' | 'etc.' <PERMISSIONS> ::= <ALL_PERMISSIONS> | <PERMISSION_LIST> <ALL_PERMISSIONS> ::= '*' <PERMISSION_LIST> ::= <PERMISSION> (',' <PERMISSION>)*
Wildcards are accepted. For global rights, category is omitted.
AddNewProfile,AddNewTeam Team:EditTeam Profile:EditAbsences,EditLanguages Project:*
The rights you specify in
|Indicates whether the application requires access to Space when the user is not online. Allowed values: |
The request must contain the "Authorization" header in the following format:
Authorization: Basic <base64(client_id + “:” + client_secret)>
To get a correct value, combine the
client_secret in a single string using semicolon as a delimiter and encode it into Base64 format.
For example, the client makes the following HTTP request using transport-layer security:
If the request is valid, Space will authenticate the client.
If the access token request is valid and authorized, the Space server issues an access token and refresh token.
If the request failed client authentication or is invalid, Space responds with an HTTP 400 (Bad Request) status code (unless specified otherwise) and includes the following parameters with the response:
A single ASCII [USASCII] error code from the following:
invalid_request— The request is missing a required parameter, includes an unsupported parameter value (other than grant type), repeats a parameter, includes multiple credentials, utilizes more than one mechanism for authenticating the client, or is otherwise malformed.
invalid_client— Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method). The authorization server may return an HTTP 401 (Unauthorized) status code to indicate which HTTP authentication schemes are supported. If the client attempted to authenticate via the "Authorization" request header field, the Space server will respond with an HTTP 401 (Unauthorized) status code and include the "WWW-Authenticate" response header field matching the authentication scheme used by the client.
invalid_grant— The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.
unauthorized_client— The authenticated client is not authorized to use this authorization grant type.
unsupported_grant_type— The authorization grant type is not supported by Space.
invalid_scope— The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.
- Human-readable ASCII [USASCII] text providing additional information, used to assist the client developer in understanding the error that occurred.
The parameters are included in the entity-body of the HTTP response using the "application/json" media type. The parameters are serialized into a JSON structure by adding each parameter at the highest structure level. Parameter names and string values are included as JSON strings. Numerical values are included as JSON numbers. The order of parameters does not matter and can vary.