Get an Authorization Token

Before you begin

  1. Deploy Proficy Historian for AWS.
  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://<NLB DNS>:9090/oauth/token
    Tip: To find the NLB DNS:
    1. Access the EKS cluster on which you have deployed Proficy Historian for AWS.
    2. Access the EC2 instance.
    3. In the navigation pane, under Load Balancing, select Load Balancers.
    4. Select the load balancer for which you want to find the DNS.
    5. In the Description section, copy the DNS name.
    Client ID Enter historian_rest_api.
    Client secret Enter the value you entered in the Password field under Proficy Authentication Configuration when you created the stack.
    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://nlb-dns:9090/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://nlb-dns:9090/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.