Use a Dynamic Access Token to Authenticate One Web API from Another in Bold Reports
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
-
Create Web API DataSource1 to fetch the access token.
This data source will call the token endpoint and return the access token response.
-
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.
-
Create a report parameter and assign the access token column from the dataset as its query value.
This allows the token to be stored and passed into another data source during execution.
-
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.
-
Create Dataset2 using DataSource2 and add the required fields to your report.
DataSource2 now authenticates using the dynamically generated access token and retrieves the required data successfully.