Get a token for authentication

For this task, we use cURL as an example of how to get a token for authentication. You must perform this task to make any Oracle InForm User Management Tool API calls.

You generate a token in order to call the Oracle InForm User Management Tool APIs. The authentication token is valid for 10 minutes after it is generated. Once the token has expired you generate a new one to continue making Oracle InForm User Management Tool API calls.

  • Reach out to your system administrator to receive the required Client ID and Secret used to generate an authentication token in cURL.
  • Access the Oracle InForm User Management Tool REST resources over HTTPS and provide an SSL certificate authority (CA) certificate file or bundle to authenticate against the Verisign CA certificate. Oracle InForm User Management Tool uses a certificate authority (CA) certificate, issued by Verisign, to enable clients to connect securely to the server.

Tips to construct your cURL command

While constructing your cURL command, remember that you must add a service to the scope <tenant_id>.umtscim.call. Also, you need a minimum of one permission in the scope.

  • When using APIs related to provisioning sites and users to your study in Oracle InForm User Management Tool, you will need to add the <tenant_id>.umtscim.call permission to the authentication token.
  • When adding data to a defined study in Oracle InForm User Management Tool you will need to add the umtscim.call permission to the authentication token.

Steps

  1. Reach out to your Oracle project manager to obtain the correct URL. The URL format is https://iams-hs-sso.iams.hs.ocs.oraclecloud.com/ms_oauth/oauth2/endpoints/<tenant_id>/tokens.

    Note:

    This URL is different from the URL that you use to make Oracle InForm User Management Tool API calls. You need this specific URL to get the authentication token that gives you access to the product's APIs.
  2. Run the following -u cURL command using the client ID and secret:
    curl -X POST https://iams-hs-sso.iams.hs.ocs.oraclecloud.com/ms_oauth/oauth2/endpoints/<tenant_id>/tokens \
     -u "<clientId>:<secret>" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     -d "grant_type=client_credentials&scope=<tenant_id>.umtscim.call"
  3. Press Enter on your keyboard.
  4. Copy the token that starts after this line:
    {"expires in":600,"token type":"Bearer","access_token":"
    until you reach the closing } in the command line.