There are two ways to manage user API scopes.
- Include API scopes in roles and assign the role to the user
- Add additional API scopes to the user (in addition to role)
You also have the option to add API scopes for users through the permissions
claim.
- Make sure the scopes already exist for your API. See Create and manage API scopes
- Add your API as an
audience
in the .env file of your SDK. For example, request multiple audiences by providing a white space separated list:
- In Kinde, go to Settings > Roles.
- Add a new role or edit an existing role.
- In the dialog that appears, switch on API scopes at the bottom of the window.
- Select Save.
- Go back to the home page in Kinde.
- Select Users.
- Find and open the record for the user you want.
- Select Roles in the menu.
- Assign the role with the relevant scopes to the user.
- In Kinde, go to Settings > Users.
- Find and open the record for the user you want.
- Select API scopes in the side menu.
- In the Additional API scopes section, select Add scopes.
- In the dialog, switch on the scopes you want.
- Select Save.
- In Kinde, go to Settings > Users.
- Find and open the record for the user you want.
- Select API scopes in the side menu. All the scopes applied to the user - via role and additional - are shown.
You can include API scopes in the permissions
claim if you want them included as part of the user’s Access token.
- Go to Settings > Applications and select View details on the relevant application for the permissions.
- Select Tokens in the side menu.
- Scroll to the Token customization section and select Customize on the Access token tile.
- In the dialog, switch on Include API scopes in the
permissions
claim.
- Select Save.