Obtain Refresh Token
Follow these steps to obtain a refresh token from GCP via a built-in GCP OAuth Client Tool:
- Download the GCP OAuth Client Tool from the link: http://download.netbraintech.com/tools/GCP-OAuthClientTool.zip. Unzip the file GCP-OAuthClientTool.zip to a folder.
- Rename the OAuth credential JSON file as client_secret.json, downloaded in step 4 of section 1.5.2 Create OAuth Client & Credential, and move it to the same folder with auth_setup.py in the GCP OAuth Client Tool folder.
- Double-click the auto_setup.py file and run it automatically to install Python library files.

It takes several minutes to install the python library installation the first time. The website browser with URL http://localhost:9000/ will pop up automatically after the installation.
- Click Authorize API Access to obtain the refresh token.

- Enter the account login information or select the correct user account for API access.

The current user account used in this step should have been assigned with proper permissions. For permissions required, please refer to Assign IAM Permission.
- Click Allow to authorize the API access.

Finally, the refresh token will show up on the website browser. Also, a JSON file named credential.json will be created automatically in the same folder as client_screte.json in the GCP OAuth Client Tool folder.
- Store the file in a local folder. Use the client ID, client secret, and refresh token value to set up the GCP API Server later.
Note: If you have issues obtaining the refresh token, contact NetBrain Support.
If you want to remove the existing credential access or obtain a refresh token again, follow these steps:
- Click Manage credential access to remove the credential access.
- Select the 3rd-party apps that need to remove access and click REMOVE ACCESS.

- Click OK to confirm.
