Skip to main content

How to get your API keys

This section will illustrate how to get your Okta FGA API keys to call the API.

Before you start

You must have an Okta FGA account. You can sign up for one on the Okta FGA dashboard.

Step by Step

When using the Okta FGA SDKs or calling the API you will need:

  • A Store ID
  • A Client ID (not needed for the Playground environment)
  • A Client Secret (not needed for the Playground environment)

In order to get your Store ID and your API keys, follow the steps below:

Management Dashboard

01. Settings page

To obtain your API keys, select "Settings" from the Dashboard's sidebar menu.

Image showing Okta FGA settings page

02. Create client and obtain client secret

  1. If you do not have the client secret, you will be presented with the Create Client button. Click this Create Client button.

Image showing Okta FGA settings page click create client

  1. Enter the client name in the provided text box. This client name will make it easier to identify your clients in the future.

Image showing Okta FGA create client page

  1. Select the permission set(s) required for this specific client. Click the Create button when done.

Image showing Okta FGA create client page with selected permissions

  1. A popup window will confirm the client has been successfully created. Make sure to copy the Store ID, Client ID, and Client Secret values. Click Continue once you have saved these values in a secure location.

Image showing Okta FGA client secret popup

caution

You will not be able to see the client secret again after this step. It will need to be regenerated if it is ever lost or compromised in any way.

03. Setting relevant environment variables

Env var/LocalityUSEuropeAustralia
FGA_API_URLhttps://api.us1.fga.devhttps://api.eu1.fga.devhttps://api.au1.fga.dev
FGA_API_AUDIENCEhttps://api.us1.fga.dev/https://api.eu1.fga.dev/https://api.au1.fga.dev/
FGA_API_TOKEN_ISSUERfga.us.auth0.comfga.us.auth0.comfga.us.auth0.com
FGA_STORE_IDsee abovesee abovesee above
FGA_CLIENT_IDsee abovesee abovesee above
FGA_CLIENT_SECRETsee abovesee abovesee above

04. Obtain bearer token

If the API is to be invoked via the API Docs viewer or directly instead of through SDKs, you will need to obtain access token for use in later steps:

# Not needed when calling the Playground API
curl -X POST \
https://fga.us.auth0.com/oauth/token \
-H 'content-type: application/json' \
-d '{"client_id":"'$FGA_CLIENT_ID'","client_secret":"'$FGA_CLIENT_SECRET'","audience":"'$FGA_API_AUDIENCE'","grant_type":"client_credentials"}'

# The response will be returned in the form
# {
# "access_token": "eyJ...Ggg",
# "expires_in": 86400,
# "scope": "read:tuples write:tuples check:tuples ... write:authorization-models",
# "token_type": "Bearer"
# }
# Store this `access_token` value in environment variable `FGA_BEARER_TOKEN`

FGA_SERVER_URL = 'https://api.us1.fga.dev/' // 'https://api.eu1.fga.dev/' for EU and 'https://api.au1.fga.dev/' for AU
Okta FGA Dashboard

Introduction to the Okta FGA Dashboard.

Have Feedback?

You can use any of our support channels for any questions or suggestions you may have.