This is a Step-by-step guide to validate an Azure AD Account using Postman. When you get an error attempting to add an Azure AD account to PBRS for PBRS, you can validate and test the settings using the utility Postman.
Validate an Azure AD Account using Postman
This is a Step-by-step guide to validate an Azure AD Account using Postman. When you get an error attempting to add an Azure AD account to PBRS for PBRS, you can validate and test the settings using the utility Postman.
Here are the steps to validate an Azure AD account using Postman:
- Download and install Postman from https://www.getpostman.com.
- Open your web browser and go to the following URL: https://login.windows.net/[azure tenantid]/oauth2/authorize/?response_type=code&client_id=[application client id]&resource=https%3a%2f%2fanalysis.windows.net%2fpowerbi%2fapi&redirect_uri=http%3a%2f%2flocalhost
- Sign into your Microsoft account and you will be redirected to a blank/error website with the address (pay attention to the web address and not the page): http://localhost/?code=[a long code]&session_state=74601f5d-67a0-4171-b576-481c3e4c08fc.
- Copy the code from the URL above and open Postman.
- Create a new POST request in Postman as shown in the image below. The API address must contain the Azure Tenant ID and you must replace the CODE and CLIENT_ID values with your own values.
- Hit the send button and you should get a response from the API that looks like:
- {
"token_type": "Bearer",
"scope": "Dashboard.Read.All Dashboard.ReadWrite.All Dataset.Read.All Dataset.ReadWrite.All Report.Read.All Report.ReadWrite.All Workspace.Read.All Workspace.ReadWrite.All",
"expires_in": "3600",
"ext_expires_in": "0",
"expires_on": "1540482281",
"not_before": "1540478381",
"resource": "https://analysis.windows.net/powerbi/api",
"access_token": "an actual access token",
"refresh_token": "an actual refresh token",
"id_token": "an actual id token"
} - Make a copy of the refresh token.
- {
Refreshing an Access Token using a Refresh Token
Azure Access Token expires after 60 minutes by default. After this period, we have to acquire a new access token using a refresh token. We will use the refresh token we obtained from our previous POST request above.
In order to refresh the token, open a new request tab in Postman and configure it as follows:
Please note that once again the API address must contain the Tenant ID and you must use the refresh token obtained above.
- Hit the Send button to get the result that looks like:
{
"token_type": "Bearer",
"scope": "Dashboard.Read.All Dashboard.ReadWrite.All Dataset.Read.All Dataset.ReadWrite.All Report.Read.All Report.ReadWrite.All Workspace.Read.All Workspace.ReadWrite.All",
"expires_in": "3600",
"ext_expires_in": "0",
"expires_on": "1540482337",
"not_before": "1540478437",
"resource": "https://analysis.windows.net/powerbi/api",
"access_token": "actual access token",
"refresh_token": "a new refresh token"
}