Articles in this section

Use a Dynamic Access Token to Authenticate One Web API from Another in Bold Reports

Published:
Updated:

This article explains how to fetch an access token from one Web API data source (DataSource1) and use it to authenticate another Web API data source (DataSource2) in Bold Reports. This approach enables dynamic token validation at runtime so the report always uses a valid access token during execution.

Step-by-Step Instructions

  1. Create Web API DataSource1 to fetch the access token.

    image.png

    This data source will call the token endpoint and return the access token response.

  2. Build a dataset to retrieve the access token. Create a dataset using DataSource1 to retrieve the Access_Token value.
    This ensures the access token is generated dynamically each time the dataset runs.

    image.png

  3. Create a report parameter and assign the access token column from the dataset as its query value.

    image.png

    This allows the token to be stored and passed into another data source during execution.

  4. Configure a second Web API data source. Create another Web API data source (DataSource2) to connect to the target API endpoint and retrieve the required data. Set the Authorization header to use the report parameter so the access token can be passed dynamically.

    image.png

  5. Create Dataset2 using DataSource2 and add the required fields to your report.

    image.png

    DataSource2 now authenticates using the dynamically generated access token and retrieves the required data successfully.

See Also

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied