The End of Life (EOL) date of Rules and Hooks will be November 18, 2026, and they are no longer available to new tenants created as of October 16, 2023. Existing tenants with active Hooks will retain Hooks product access through end of life.We highly recommend that you use Actions to extend Auth0. With Actions, you have access to rich type information, inline documentation, and public
npm
packages, and can connect external integrations that enhance your overall extensibility experience. To learn more about what Actions offer, read Understand How Auth0 Actions Work.To help with your migration, we offer guides that will help you migrate from Rules to Actions and migrate from Hooks to Actions. We also have a dedicated Move to Actions page that highlights feature comparisons, an Actions demo, and other resources to help you on your migration journey.To read more about the Rules and Hooks deprecation, read our blog post: Preparing for Rules and Hooks End of Life.Allow access only on weekdays for a specific application
Let’s say you have an application that you want to make sure is only accessible during weekdays. To do this, you would create the following rule:Allow access only to users who are inside the corporate network
Let’s say you want to allow access to an application, but only for users who are accessing the application from inside your corporate network. To do this, you would create the following rule:Deny access to anyone calling an API
Let’s say you want to deny access to all users who are calling an API. This means that you need to deny access depending on theaudience
value for your API, which you can find in the API field of your API in Dashboard > Applications > APIs. To do this, you would create the following rule:
audience
value for the API is http:://todoapi2.api
, so this is the audience we will refuse. If anyone tries to access the API with this audience
value, they will be denied access and receive an HTTP 401
response.
Add user roles to tokens
If you enable RBAC for APIs along with “Add Permissions in the Access Token” (or enable RBAC via the and set the Token Dialect toaccess_token_authz
), you will receive user permissions in your Access Tokens. To add user roles to tokens, you would use the context.authorization
object when you create the following rule:
Manage Delegated Administration Extension roles using the Authorization Core feature set
Although the Delegated Administration Extension (DAE) and the Authorization Core feature set are completely separate features, you can use the Authorization Core feature set to create and manage roles for the DAE if you use a rule.- Create DAE roles using the Authorization Core feature set. The names of the roles you create must match the names of the pre-defined DAE roles.
- Assign the DAE roles you created to the appropriate users using the Authorization core feature set.
- Add user roles to the DAE namespace in the ID Token. To do so, create the following rule, remembering to replace the
CLIENT_ID
placeholder value with your application’s Client ID:
Auth0 returns profile information in a structured claim format as defined by the OpenID Connect (OIDC) specification. This means that custom claims added to ID tokens or access tokens must conform to guidelines and restrictions to avoid possible collisions.