BigID API/Token Authentication: Difference between revisions

From BigID Developer Portal
No edit summary
Line 64: Line 64:
<iframe style="border:0px; width:100%; height:400px; border-radius:10px;" src='https://apibrowser.mybigid.com/?url=refresh-access-token&method=GET&headers=%5B%7B%22name%22%3A%22Authorization%22%2C%22value%22%3A%22TOKEN%20HERE%22%7D%5D&selectedSetting=headers'></iframe>
<iframe style="border:0px; width:100%; height:400px; border-radius:10px;" src='https://apibrowser.mybigid.com/?url=refresh-access-token&method=GET&headers=%5B%7B%22name%22%3A%22Authorization%22%2C%22value%22%3A%22TOKEN%20HERE%22%7D%5D&selectedSetting=headers'></iframe>
</html>
</html>
In response to this request you'll get the following:
<syntaxhighlight lang="JSON" line highlight="3">
{
    "success": true,
    "systemToken": "eyJhbGciOiJIUzI1N<don't copy me! I'm just an example!>..."
}
</syntaxhighlight>

Revision as of 19:07, 3 March 2022

In this tutorial we're going to authenticate with BigID using a user token to retrieve a list of data sources.

First we'll need to create a user token for us to use through the BigID UI.

If you don't have access to a BigID environment to get a token, you can get one from the sandbox by running the automation after the steps.

Generate a Token

To do this we need to navigate to the Access Management screen under Administration -> Access Management. On the Access Management screen, select the user you want to create a token for from the System Users List. Then press the Generate button to start the token creation process.

Tokens can only be valid for up to 999 days. Since we're just using this token for testing, let's set it to 30 days and then click Generate like in the screenshot below.

On the next screen you'll see a name for the token as well as the token value. Copy the token value by clicking the icon to the right of it then close the dialog. You can't see the token value again so be sure you have saved it someplace safe.

Finally, save the user so the token can take effect.

Use the tool below to generate a token for the sandbox.

Exchange a token for an API key

Now that we have a user token, we need to exchange it for a system token that we can use to access API endpoints. This uses the /api/v1/refresh-access-token endpoint like below. Replace the TOKEN HERE in the request headers with your previously obtained user token and click Send to get a system token.

In response to this request you'll get the following:

{
    "success": true,
    "systemToken": "eyJhbGciOiJIUzI1N<don't copy me! I'm just an example!>..."
}