Skip to content

Replace Auth0 Rules with Auth0 Actions#1375

Open
avanscoy wants to merge 1 commit into
mainfrom
fix/docs-5525
Open

Replace Auth0 Rules with Auth0 Actions#1375
avanscoy wants to merge 1 commit into
mainfrom
fix/docs-5525

Conversation

@avanscoy

Copy link
Copy Markdown
Contributor

Description

Replaces an article on Auth0 Rules with Auth0 Actions

References

Testing

Checklist

  • I've read and followed CONTRIBUTING.md.
  • I've tested the site build for this change locally.
  • I've made appropriate docs updates for any code or config changes.
  • I've coordinated with the Product Docs and/or Docs Management team about non-trivial changes.

@avanscoy avanscoy requested a review from a team as a code owner June 11, 2026 15:10
@github-actions

Copy link
Copy Markdown
Contributor

Summary

Status Count
🔍 Total 5
✅ Successful 0
⏳ Timeouts 0
🔀 Redirected 0
👻 Excluded 5
❓ Unknown 0
🚫 Errors 0
⛔ Unsupported 0
Full Github Actions output

@mintlify

mintlify Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
auth0 🟢 Ready View Preview Jun 11, 2026, 3:24 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@avanscoy avanscoy added the main-docs Changes related to auth0's main docs (https://auth0.com/docs) label Jun 11, 2026
@mintlify

mintlify Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
auth0-docs-dev 🟢 Ready View Preview Jun 11, 2026, 3:24 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mintlify

mintlify Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
auth0-docs-staging 🟢 Ready View Preview Jun 11, 2026, 3:28 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@hazel-nut hazel-nut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some thoughts since we're in here anyway, though i know the content is largely transposed from the original without editing. we can modify them in a follow-up if you prefer 😊

const ipaddr = require('ipaddr.js');

exports.onExecutePostLogin = async (event, api) => {
const corp_network = "192.168.1.134/26";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use one of the RFC reserved IP addresses for documentation here? https://datatracker.ietf.org/doc/html/rfc5737


You could also trigger this Action based on other criteria, such as whether the current IP matches the user's IP allowlist or whether geolocating the user reveals they are in a different country from the one listed in their user profile.

</Callout>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can remove this callout and add this info in normal text after the initial code sample (maybe with some links to content that would help the reader know how to implement some of them, if we have any)? it seems nicer as a transition in a next steps kind of way. :)

Comment on lines +28 to +37
// is auth method passwordless and IP outside corp network?
const passwordlessOutside = event.authentication.methods.find(
(method) => (
((method.name === 'sms') || (method.name === 'email')) &&
(!current_ip.match(ipaddr.parseCIDR(corp_network)))
)
);

// if yes, then require MFA
if (passwordlessOutside) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// is auth method passwordless and IP outside corp network?
const passwordlessOutside = event.authentication.methods.find(
(method) => (
((method.name === 'sms') || (method.name === 'email')) &&
(!current_ip.match(ipaddr.parseCIDR(corp_network)))
)
);
// if yes, then require MFA
if (passwordlessOutside) {
const usesPasswordlessAuth = event.authentication.methods.some(
(method) => method.name === 'sms' || method.name === 'email';
);
const outsideCorpNetwork = !current_ip.match(ipaddr.parseCIDR(corp_network));
if (usesPasswordlessAuth && outsideCorpNetwork) {

since we're updating this code anyway: better to use includes() or some() when just testing for existence, and simpler & more readable to not embed the IP match inside the second condition's callback.


With [Actions](/docs/customize/actions/actions-overview), you can handle more complicated cases than is possible with [passwordless connections](/docs/authenticate/passwordless) alone. For instance, you can add extra precautions to further ensure possession of an email address or device.

## Require Multi-factor Authentication for users who are outside the corporate network

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Require Multi-factor Authentication for users who are outside the corporate network
## Require multi-factor authentication for users who are outside the corporate network

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

main-docs Changes related to auth0's main docs (https://auth0.com/docs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants