Get an Authorization Token

Before you begin

  1. Deploy Proficy Historian for Azure Cloud.
  2. Install an API platform (such as Postman).

About this task

To connect the Historian server with the REST APIs, you must get an authorization token.

Procedure

  1. Access an API platform, and request for an authorization token.
  2. Enter values as described in the following table and submit.
    Note: The names of these fields may vary depending on the API platform that you are using.
    Field Description
    Token name Provide a name for the token.
    Grant type Select Client Credentials.
    Access token URL Enter a value in the following format: https://<Azure Load Balancer IP>:8080/oauth/token
    Tip: To find the Azure Load Balancer IP:
    1. Go to the Azure portal.
    2. Go to the Resource Group that was specified during deployment.
    3. Select the cluster_name-IP to access the resource of type Public IP Address.
    4. Select or copy the IP Address.
    Client ID Enter historian_rest_api.
    Client secret Enter the value you entered in the Password field at the time of deployment.
    The token is generated. You can use this token to use REST APIs.
  3. Use the following command to authenticate the REST API authentication with password credentials:
    curl -d "client_id=<value>&client_secret=<value>&grant_type=password&username=<value>&password=<value>&token_format=opaque&response_type=token" https://Azure-Load-Balancer-IP:8080/oauth/token
    For example:
    curl -d "client_id=server1.admin&client_secret=adminsecret&grant_type=password&username=user1&password=pwd123&token_format=opaque&response_type=token" https://Azure-Load-Balancer-IP:8080/oauth/token

    The following image shows an example of OAuth access. The actual token text is blurred for security concerns.

    Client applications can access data using service the REST API endpoints. Your application makes an HTTP request and parses the response. You can use any web-development language to access the APIs.