Connect frontend and backend authentication
A frontend signs users in and calls a protected backend.
Kinde · Module
Kinde API registration gives an API a name and unique audience, then lets you authorize applications to use it. A linked API can be included in access-token audience claims for backend authentication.
Register an API in Kinde by giving it a name and unique audience, then authorize applications that need to call it. Linking the API to an application allows the API audience to appear in access-token claims for backend authorization.
const audience = "https://api.example.com";
console.log({
apiName: "Orders API",
audience,
tokenClaim: "aud"
});A minimal illustration of the stable concepts: an API has a name and unique audience, which can be included in an access token's aud claim.
A frontend signs users in and calls a protected backend.
A service needs its identity represented in access tokens.
An organization manages several backend services.
Registering an API gives it a name and audience, where the audience uniquely identifies the API. After saving it, authorize the relevant application so the API can be used in that application's access-control setup.
Follow-up: How can an API become an access-token audience? Link the registered API to a Kinde application; the API can then be included in the token's aud claim.
The audience is the identifier used for the API, commonly a short code or the API URL. It provides the value that identifies the intended backend API.
Follow-up: What should be done if the audience needs to change? Because the documentation says the audience is not editable, create or register the appropriate API identity rather than relying on an in-place edit.
After creating the API, open the relevant application and authorize it for that API. This connects the application to the API for authenticated access.
Follow-up: How can access be narrowed further? Define API scopes and manage which scopes the application is allowed to use.
API scopesKinde applicationaud claimOpenAPI specAPI keys