Security plugins for Auth0
npm install @webiny/api-security-auth0



In .env file, add your Auth0 variables:
``yamlAuth0 variables for the API.
AUTH0_DOMAIN=https://dev-12345678.us.auth0.com
AUTH0_CLIENT_ID=111111111111111
Auth0 Action to add custom claims:
`js
/**
* Handler that will be called during the execution of a PostLogin flow.
*
* @param {Event} event - Details about the user and the context in which they are logging in.
* @param {PostLoginAPI} api - Interface whose methods can be used to change the behavior of the login.
*/
exports.onExecutePostLogin = async (event, api) => {
if (event.authorization) {
api.idToken.setCustomClaim(webiny_group, event.user.app_metadata.group);
}
};
``