![]() |
API Documentation
|
All features of Covata technologies are accessed through a Covata user account, which is registered on the Covata Platform. For more information about Covata users, refer to the Administering users within an organization page of the Safe Share Organization Administrator's Guide.
In almost all cases, to access resources on the Covata Platform through its API, your application requires a Covata user account that has been authenticated and authorized to the Covata Platform. The accessible resources on the Covata Platform are those to which that Covata user account is permitted to access.
The Covata API utilizes the OAuth 2.0 Authorization Framework to authenticate and authorize Covata user accounts securely to the Covata Platform.
The OAuth 2.0 process (or 'dance') to obtain an access token (1) using the authorization code grant type (2) consists of the following steps:
The authorization code grant type process for obtaining an access token provides the maximum security features offered by OAuth 2.0, since a Covata user's credentials are not specified directly through your client application and the client credentials (3) can be kept as secure as possible (on the proviso that your client application is a server-side web application and properly implements TLS).
The Covata API also provides support for the implicit and password grant types, which are also part of the OAuth 2.0 Authorization Framework. These additional grant types provide authentication/authorization solutions for a wider range of client application types and are simpler processes than that for the authorization code grant type described above. However, both the implicit and password grant types do not possess all the security features provided by the authorization code grant type process.
(1) An access token defines a set of accessible resources available to a user on the Covata Platform. For more information about Covata Platform access and refresh tokens, refer to the description of the Grant types field on the Configuring client applications page of the Safe Share Administrator's Guide.
(2) An OAuth 2.0 grant type is a credential representing a Covata user's authorization to access that user's protected resources on the Covata Platform.
(3) A set of client credentials is an identity for your client application and consists of both a client ID and a client secret. Client credentials are analogous to user credentials, whereby a username/email address and password (for identifying a person) are equivalent to the client ID and client secret, respectively.
The following table lists different client application types and the corresponding OAuth grant types best suited for these application types:
| Client application type | Recommended OAuth 2.0 grant types |
|---|---|
| Server-side web application | Authorization code |
| Native desktop/laptop or mobile application | Authorization code * or Password * (if the client application was developed by Covata) |
| User agent (e.g. client-side application running in a web browser) | Implicit or Authorization code (if you would like your application to use refresh tokens to obtain new access tokens) |
| Administrator/system-run service (e.g. Java scheduled job) | Password |
* When deciding on which of these grant types to implement in your client application, the authorization code may provide more security or trust than password, in that a Covata user's credentials are not specified directly through your client application when the user authenticates to the Covata Platform. This grant type decision would most likely amount to the level of trust that parties outside your organization have in your application.
Before developing your application, you should consult your Safe Share administrator to begin the process of registering your application on the Covata Platform.
After agreeing on the grant type(s) that your application will implement, your Safe Share administrator can proceed with your application's registration process.
Once your application is registered, your Safe Share administrator should securely issue you with client credentials (a client ID and client secret) to hard code into your application. These credentials are used to 'authenticate' your application to the Covata Platform.
Be aware, however, that if your application is a native desktop/laptop, a mobile or a user agent-based application, then client credentials are less secure than they would be for a server-side web application (with properly implemented TLS). Therefore in these circumstances, your Safe Share administrator may allow you to generate your own client credentials.
See Configuring client applications in the Safe Share Administrator's Guide for more information.
The following steps outline the Covata API OAuth 2.0 process for authenticating and authorizing your application to access a Covata user's resources on the Covata Platform:
The authentication and authorization process begins by initiating appropriate requests to the Covata Platform to obtain an access token. The nature of these requests differs depending on one of the three supported OAuth 2.0 grant types your application has permission to use:
Once the authentication and authorization process is successful, an access token is returned to your application. Pass this token in subsequent requests to the Covata Platform to perform other interactions and activities through the Covata API.
Step (1)
To obtain an access token from the Covata Platform using the authorization code grant type, make an initial GET method request to this API endpoint:
with the following URL parameters:
response_type - Use the value codeclient_id - The client ID of your application's client credentials, which would have been generated when your application was registered on the Covata Platform.redirect_uri - Your application's URL/URI, which will handle the initial response from the Covata Platform that contains the actual authorization code. This initial response is sent after the user has successfully authenticated.The purpose of this request is to begin the process of authenticating a user to the Covata Platform, by presenting the user with the Covata Sign-in page.
Example initial request:
Step (2)
Once the Covata user has successfully authenticated (and if required, has accepted the application approval step), the Covata Platform responds by redirecting to your application's URL/URI (i.e. the redirect_uri value above) to handle the authorization code, whose value is the code URL parameter.
For example:
To complete the authentication and authorization process, your application should make a 2nd request to the Covata Platform to this API endpoint (using the POST method):
with the following parameters sent as form URL-encoded (i.e. application/x-www-form-urlencoded) data in the request's body:
grant_type - Use the value authorization_codecode - The value of the authorization code returned by the the Covata Platform (and initially handled by your application through the redirect URI).redirect_uri - Your application's URL/URI that handled the initial response from the Covata Platform that contained the actual authorization code.This 2nd request requires HTTP Basic authentication specified in its header, whose value is the string value of your application's client ID and client secret (separated by a colon) and encoded with Base64.
Tip: The client ID and client secret values constitute your application's client credentials, which would have been generated when your application was registered on the Covata Platform.
For example, encoding:
exampleClientApplication:exampleClientApplicationSecret ZXhhbXBsZUNsaWVudEFwcGxpY2F0aW9uOmV4YW1wbGVDbGllbnRBcHBsaWNhdGlvblNlY3JldA==Example 2nd request:
Note: Submitting a cURL command like the one above with at least one
-doption results in the following header:
Content-Type: application/x-www-form-urlencoded
being automatically included in the request. Be aware that this header is required for the request to succeed.
The Covata Platform responds with an access token. Continue on to Receiving the access token from authorization code grant type requests for details.
To obtain an access token from the Covata Platform using the implicit grant type, make a single GET method request to this API endpoint:
with the following URL parameters:
response_type - Use the value tokenclient_id - The client ID of your application's client credentials, which would have been generated when your application was registered on the Covata Platform.redirect_uri - Your application's URL/URI, which will handle the response from the Covata Platform that contains the access token itself. This response is sent after the user has successfully authenticated.The purpose of this request is to begin the process of authenticating a user to the Covata Platform, by presenting the user with the Covata Sign-in page, which if successful, results in the direct retrieval of the access token.
Example request:
Once the Covata user has successfully authenticated, the Covata Platform responds with an access token. Continue on to Receiving the access token from implicit grant type requests for details.
To obtain an access token from the Covata Platform using the password grant type, simply make a single POST method request to this API endpoint:
with the following parameters sent as form URL-encoded (i.e. application/x-www-form-urlencoded) data in the request's body:
grant_type - Use the value passwordusername - The email address of a Covata user's credentials (acquired through your application).password - The password of a Covata user's credentials (acquired through your application).Like above, this request requires HTTP Basic authentication specified in its header, whose value is the string value of your application's client ID and client secret (separated by a colon) and encoded with Base64.
Tip: The client ID and client secret values constitute your application's client credentials, which would have been generated when your application was registered on the Covata Platform.
For example, encoding:
exampleClientApplication:exampleClientApplicationSecret ZXhhbXBsZUNsaWVudEFwcGxpY2F0aW9uOmV4YW1wbGVDbGllbnRBcHBsaWNhdGlvblNlY3JldA==Example request:
Note: Submitting a cURL command like the one above with at least one
-doption results in the following header:
Content-Type: application/x-www-form-urlencoded
being automatically included in the request. Be aware that this header is required for the request to succeed.
The Covata Platform responds with an access token. Continue on to Receiving the access token from password grant type requests for details.
Once the authentication and authorization processes for either the authorization code or password grant type above is successful (via the final POST method request to the <access-service>/api/oauth/token API endpoint), the Covata Platform responds with an access token in the body of the response (as a JSON object) as well as a refresh token (if your registered client application on the Covata Platform has been configured to issue one).
Example response:
Once the authentication and authorization process for the implicit grant type above is successful (via the GET method request to the <access-service>/api/oauth/authorize API endpoint), the Covata Platform responds by redirecting to your application's URL/URI (i.e. the redirect_uri value above) with an access token as a URL parameter (amongst other parameters).
Example response: