To securely connect to Kinde’s API, you need to obtain an access token. The following procedure describes how to get the token using Postman - an API platform - but you can follow similar steps in your own app environment.
You need to have a machine to machine application set up and have the domain details, Client ID and Client secret on hand.
We recommend you do this in a non-production environment first.
If you decide to use Postman, we recommended that you set up a Postman environment.
- Add your Kinde machine to machine app’s settings as environment variables, i.e. the
domain
,client_id
, andclient_secret
from the application.
- Go to Collections. Create a new collection called Kinde.
- In the three dots menu next to the new Kinde folder, select Add request.
- Rename it
client_credentials
or whatever best describes what your purpose is. - Go to the Authorization section and set the Type to OAuth 2.0 and ensure the Header Prefix is set to Bearer.
- In the Configure New Token > Configuration options section, set the Grant Type to Client Credentials. This is the grant type for hitting the users end point in the Kinde API.
- Enter the Access Token URL, using the domain variable you created above. For example,
{{business_domain}}.kinde.com/oauth2/token
. Note that even if you use a custom subdomain domain, the access token URL needs to include thekinde.com
domain.
-
Enter the Client ID and Client Secret using the environment variables you created earlier or by copying them from the Kinde application.
-
Set the Audience to
https://[yourdomain].kinde.com/api
. There are two different ways this can be done:- Under Advanced Options (or Audience and Resources), enter the URL against the
audience
option. - If step a) does not work for you, add the audience value to the body of the request. Select Body, then select the
audience
option and add the URL.
- Under Advanced Options (or Audience and Resources), enter the URL against the
-
Go to the Headers tab.
- Select Accept and ensure the value is
application/json
. - In the Authorization section, select Get New Access Token. If it works, you should see a confirmation message.
- Select Proceed.
- Select Use Token. You should now have the access token for making requests to the Kinde management API. See the Kinde API documentation for all the available end points.
- Next (optional): Test the connection to Kinde’s API.