Forum Discussion
Connecting to Box
Hi Anonymous
As i don't have a BOX account, i can't test it with power bi. Maybe the following link can give you some ideas .
Power BI - Get JWT Token from Auth API
Regarding to get token from JWT Application, it isn't the matter from power bi side, you may read this article to know more about JWT.
GET the TOKEN: The token should be present in the header with name jwt-token (you can choose your custom name or send it in authorization header after all it’s custom contract). Also, the best practice is to send it via Authorization Bearer scheme.
Best Regards
Maggie
Hey Maggie,
Thanks, that's helpful, but I still don't know what to do.
How do I get the token? Namely, without the packages used here available for PowerBI: https://developer.box.com/docs/construct-jwt-claim-manually, Can I still get the Bearer token?
Copying the steps from that page,
- Read JSON config - Read the private key, password, enterprise ID, and more from the configuration file.
- Decrypt private key - The private key is encrypted and needs to be decoded before we can use it
- Create JWT assertion - We need to create a signed JWT assertion that we can use to authenticate to the API
- Request Access Token - With this JWT assertion we can then request an Access Token from the authorization endpoint
- Make any API call - With the Access Token we can then make any API call needed
I have all the information from the json file (Step 1).
I have no idea how I can use Power Query to decrypt the private key (Step 2)
For the JWT assertion, I have no idea how I can create the jti (unique hex code) I believe I should be able to get the unix time from powerBI doing something like this. Once I have that, I still need a way to convert it into the JWT Assertion which for instance in python is done using the "jwt" package. (Step 3)
I'm quite confident steps 4 and 5 will be similar to my first post to achieve.