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.configuration
object. Do not store these values as literals in your rules code. For example, do not write code like this:
const myApiKey = 'abc123';
Instead, prefer to store (secret) information so that it’s accessible via the configuration
object:
const myApiKey = configuration.myApiKey;
context
object when and where necessary.
In a similar fashion, avoid passing any aspect of the auth0
object outside of a rule.
tenant id
).
if( _.findIndex(connection.options.domain_aliases, function(d){ return user.email.indexOf(d) >= 0;
the code (above) would return true
given emails such as:
user.domain.com@not-domain.com
user@domain.com
”@not-domain.com
(quotes included)const emailSplit = user.email.split('@'); const userEmailDomain = emailSplit[emailSplit.length - 1].toLowerCase();
To learn more, see the Check if user email domain matches configured domain rule template on GitHub, or navigate to Auth0 Dashboard > Auth Pipeline > Rules, and select Create.
allowRememberBrowser
or context.authentication
should be the only options considered for contextual bypass when using out-of-box MFA. Setting allowRememberBrowser
to true
lets users check a box so they will only be prompted for MFA periodically, whereas context.authentication
can be used safely and accurately to determine when MFA was last performed in the current browser context; you can see some sample use of context.authentication
in the out-of-box supplied rule, Require MFA once per session.
context.request.query.prompt === 'none'
)user.app_metadata.lastLoginDeviceFingerPrint === deviceFingerPrint
)user.app_metadata.last_location === context.request.geoip.country_code
)