Here are the detailed steps to set up the OAuth 2.0 authentication between Autodesk Forge and Power BI.
Step 1: Register Your Application in Autodesk Forge
Go to the Autodesk Forge Developer Portal and log in with your Autodesk account.
Go to the Applications section and click on Create Application.
Provide a name, description, and callback URL for your Application. The callback URL should match the URL that Power BI will redirect to after authentication.
Once registered, you'll receive a Client ID and Client Secret, which you should keep safe because they will be needed in the future for your OAuth 2.0 setup.
Step 2: Configure the OAuth 2.0 in Power BI
Open Power BI Desktop and navigate to Home > Get Data.
HTTP endpoints access the Autodesk Forge APIs; hence, the selected source is the Web.
It will ask Advanced to set up the API URL for authentication and data requests.
Then, to connect, make that POST request at https://developer.api.autodesk.com/authentication/v1/authenticate, which will give you an access token from Autodesk Forge using Postman.
You should be required to pass in your Client ID and Client Secret in the request body, along with the appropriate scopes (e.g., data: read, bucket:read).
You'll take the access token and copy it to Power BI as soon as you are successful.
Step 3: Power BI Connects Autodesk Forge
In Advanced Web Source settings, put any of the Forge API endpoints, such as https://developer.api.autodesk.com/.... The request should be configured with a provided access token. You can do this by adding "Authorization: Bearer <access_token>" in the header configuration.
Try the connection to see if Power BI is capable of viewing Autodesk Forge API data.
Step 4: Automated Refresh of Token
Since the token contains OAuth, it is time to refresh the token automatically.
For purposes of asking for new tokens regularly, use any of the following if a Power BI data gateway, a script, or a tool such as Python or PowerShell is used.
Remember to synergize your refresh mechanism with the safe storage and retrieval of your newly acquired access tokens.
Step 5: Troubleshooting Common Problems Invalid ClientId/Secret: cross-check on credentials from Autodesk Forge Developer Portal Callback URL not matching the callback URL in Power BI and Forge application settings. Token Expiry: Frequent token refreshes should be scheduled, especially if your dashboards are real-time.
API Limits: Confirm the Autodesk Forge API rate limit and optimize your queries to avoid exceeding them.
By following these steps, you can securely link Power BI to Autodesk Forge via OAuth 2.0, ensuring seamless integration and reliable access to data.