Protect your API
SDKs and APIs
If you manage your application’s data using APIs, you can register them with Kinde.
Doing this facilitates authentication between your back-end code framework and front-end application where users sign in.
When you register your API with Kinde and link it to a Kinde application, the API will be in the audience (aud
) claim of the token. The token can then be used to make a request from the front-end to the back-end, which verifies the token and checks the aud
claim.
aud
) is a unique identifier for this API. Often a short code or the URL of the API is used.Our SDKs accept an audience
parameter. As an example for the React SDK you would use:
When the request is received, Kinde will check that an API with a matching audience has been registered and is enabled for the application with the requested clientId. (In the example above someClientId
). If there is a match it will return the aud
claim as part of the Access token. For example:
When you use this Access token in your product and send it to your product’s API, you can check for the existence of this aud
claim in the token as part of your verification checks.
If you are using Postman, you can include the audience
claim in a token request. If you’re doing it manually, send a POST request to this endpoint: https://<your_subdomain>.kinde.com/oauth2/token
and include the following in the body.
If you no longer need to have an API registered in Kinde, you can delete it. This action cannot be reversed.