Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 27 additions & 19 deletions main/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@
"pages": [
"docs/authenticate/custom-token-exchange",
"docs/authenticate/custom-token-exchange/cte-example-use-cases",
"docs/authenticate/custom-token-exchange/configure-custom-token-exchange",
"docs/authenticate/custom-token-exchange/configure-custom-token-exchange",
"docs/authenticate/custom-token-exchange/cte-multi-factor-authentication",
"docs/authenticate/custom-token-exchange/cte-attack-protection"
]
Expand Down Expand Up @@ -1325,9 +1325,16 @@
{
"group": "Actions",
"pages": [
"docs/customize/actions",
"docs/customize/actions/actions-overview",
"docs/customize/actions/write-your-first-action",
{
"group": "Actions Modules",
"pages": [
"docs/customize/actions/modules/actions-modules-overview",
"docs/customize/actions/modules/write-your-first-action-module"
]
},
"docs/customize/actions/action-coding-guidelines",
{
"group": "Explore Triggers",
"pages": [
Expand Down Expand Up @@ -1413,11 +1420,12 @@
]
},
"docs/customize/actions/use-cases",
"docs/customize/actions/action-coding-guidelines",
"docs/customize/actions/transaction-metadata",
"docs/customize/actions/limitations",
"docs/customize/actions/actions-real-time-logs",
"docs/customize/actions/actions-templates",
"docs/customize/actions/actions-npm",
"docs/customize/actions/actions-unit-test",
"docs/customize/actions/transaction-metadata",
"docs/customize/actions/manage-dependencies",
"docs/customize/actions/manage-versions",
"docs/customize/actions/test-actions",
Expand All @@ -1431,9 +1439,7 @@
"docs/customize/actions/migrate/migrate-from-hooks-to-actions",
"docs/customize/actions/migrate/actions-migration-limitations"
]
},
"docs/customize/actions/actions-templates",
"docs/customize/actions/actions-real-time-logs"
}
]
},
{
Expand Down Expand Up @@ -3879,7 +3885,7 @@
"docs/fr-ca/customize/login-pages/advanced-customizations/configure",
"docs/fr-ca/customize/login-pages/advanced-customizations/quickstart",
"docs/fr-ca/customize/login-pages/advanced-customizations/development-workflow",
"docs/fr-ca/customize/login-pages/advanced-customizations/deployment-workflow",
"docs/fr-ca/customize/login-pages/advanced-customizations/deployment-workflow",
{
"group": "Cas d'utilisation",
"pages": [
Expand Down Expand Up @@ -4016,7 +4022,6 @@
{
"group": "Actions",
"pages": [
"docs/fr-ca/customize/actions",
"docs/fr-ca/customize/actions/actions-overview",
"docs/fr-ca/customize/actions/write-your-first-action",
{
Expand Down Expand Up @@ -4096,8 +4101,10 @@
},
"docs/fr-ca/customize/actions/use-cases",
"docs/fr-ca/customize/actions/action-coding-guidelines",
"docs/fr-ca/customize/actions/limitations",
"docs/fr-ca/customize/actions/transaction-metadata",
"docs/fr-ca/customize/actions/limitations",
"docs/fr-ca/customize/actions/actions-real-time-logs",
"docs/fr-ca/customize/actions/actions-templates",
"docs/fr-ca/customize/actions/manage-dependencies",
"docs/fr-ca/customize/actions/manage-versions",
"docs/fr-ca/customize/actions/test-actions",
Expand All @@ -4110,9 +4117,7 @@
"docs/fr-ca/customize/actions/migrate/migrate-from-hooks-to-actions",
"docs/fr-ca/customize/actions/migrate/actions-migration-limitations"
]
},
"docs/fr-ca/customize/actions/actions-templates",
"docs/fr-ca/customize/actions/actions-real-time-logs"
}
]
},
{
Expand Down Expand Up @@ -6364,7 +6369,6 @@
{
"group": "Actions",
"pages": [
"docs/ja-jp/customize/actions",
"docs/ja-jp/customize/actions/actions-overview",
"docs/ja-jp/customize/actions/write-your-first-action",
{
Expand Down Expand Up @@ -6444,8 +6448,10 @@
},
"docs/ja-jp/customize/actions/use-cases",
"docs/ja-jp/customize/actions/action-coding-guidelines",
"docs/ja-jp/customize/actions/limitations",
"docs/ja-jp/customize/actions/transaction-metadata",
"docs/ja-jp/customize/actions/limitations",
"docs/ja-jp/customize/actions/actions-real-time-logs",
"docs/ja-jp/customize/actions/actions-templates",
"docs/ja-jp/customize/actions/manage-dependencies",
"docs/ja-jp/customize/actions/manage-versions",
"docs/ja-jp/customize/actions/test-actions",
Expand All @@ -6458,9 +6464,7 @@
"docs/ja-jp/customize/actions/migrate/migrate-from-hooks-to-actions",
"docs/ja-jp/customize/actions/migrate/actions-migration-limitations"
]
},
"docs/ja-jp/customize/actions/actions-templates",
"docs/ja-jp/customize/actions/actions-real-time-logs"
}
]
},
{
Expand Down Expand Up @@ -20073,7 +20077,11 @@
},
{
"source": "/docs/actions",
"destination": "/docs/customize/actions"
"destination": "/docs/customize/actions/actions-overview"
},
{
"source": "/docs/customize/actions",
"destination": "/docs/customize/actions/actions-overview"
},
{
"source": "/docs/authenticate/protocols/scim/configure-inbound-scim/inbound-scim-for-okta-workforce-connections",
Expand Down
71 changes: 0 additions & 71 deletions main/docs/customize/actions.mdx

This file was deleted.

13 changes: 13 additions & 0 deletions main/docs/customize/actions/action-coding-guidelines.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ Follow the guidelines below to write performant, secure, and clear Actions code
* Actions should never intentionally throw an error; if processes stop because of an error or condition, use the appropriate `api` method like `api.access.deny()`.
* Use `event.request.hostname` for the domain used in Authentication API calls; this could be the default Auth0 tenant domain or a [custom domain](/docs/customize/custom-domains).

## Actions Modules

* Use Actions Modules when there is a need to reuse functions across different Actions, preventing code redundancy.
* Save object instantiation time when possible, by implementing Singleton pattern to reuse object instances at the Action Module.
* Follow the applicable guidelines shared in this document regarding coding, security, logging, dependencies, and user data.
* When using an Action Module from an Action, always be aware of the module version that is being used.

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">

When publishing a new Action Module version, it doesn't automatically upgraded the version referenced at the Actions, preventing potential breakage when the upgrade is not compatible with the Action.

</Callout>

## Coding basics

* Check for strict equals `===` with any incoming or stored data.
Expand Down
2 changes: 1 addition & 1 deletion main/docs/customize/actions/actions-npm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ In your `tsconfig.json`, define any development dependencies to have intelliSens
</Tab>
</Tabs>

#### Post-Login access control and ID token custom claims
### Post-Login access control and ID token custom claims

The following example Action would execute during the Post-Login flow. It checks if the user has roles assigned, and calls `api.access.deny()` if none are found. If roles are present, it proceeds to set the custom claim on the ID token.

Expand Down
15 changes: 11 additions & 4 deletions main/docs/customize/actions/actions-overview.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
description: Describes how Auth0 Actions work and what you can accomplish with them.
title: Understand How Auth0 Actions Work
sidebarTitle: Overview
---
Actions are secure, tenant-specific, [versioned](/docs/customize/actions/manage-versions) functions written in Node.js that execute at certain points within the Auth0 platform. Actions are used to customize and extend Auth0's capabilities with custom logic.

Expand Down Expand Up @@ -115,22 +116,28 @@ What an Action can do is determined by where it is executed within the Auth0 run
* An Action can be edited and tested without affecting the version that is currently serving production traffic.
* If an issue is found within an Action, it can be rolled back to a previous version.

### Reuse custom functions

* Create, manage, and share functions between Actions using [Actions Modules](/docs/customize/actions/modules/actions-modules-overview).

### Access to npm packages

Nearly all [public `npm` packages](https://www.npmjs.com/) are available to be used within Actions.
* Nearly all [public `npm` packages](https://www.npmjs.com/) are available to be used within Actions.

### Observability

When Actions are executed, Auth0 will capture key metrics about them and link them to [Auth0 Logs](/docs/deploy-monitor/logs).
* When Actions are executed, Auth0 will capture key metrics about them and link them to [Auth0 Logs](/docs/deploy-monitor/logs).
* When debugging, use the [Actions Real-time Logs](/docs/customize/actions/actions-real-time-logs) feature.

### Multiple Actions on every trigger

Every Action trigger supports multiple independent Actions.
* Every Action trigger supports multiple independent Actions.

## Get started

* [Write your first Action](/docs/customize/actions/write-your-first-action)!
* See the current [limitations of Actions](/docs/customize/actions/limitations).
* See the current [Action Coding Guidelines](/docs/customize/actions/action-coding-guidelines).
* See the current [Actions Limitations](/docs/customize/actions/limitations).

## Learn more

Expand Down
19 changes: 8 additions & 11 deletions main/docs/customize/actions/limitations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ title: Actions Limitations
---
The following limitations exist when using Actions:

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
Learn more about Entity Limits, read: [Actions Entity Limits](/docs/troubleshoot/customer-support/operational-policies/entity-limit-policy#actions).
</Callout>

## Actions

* Each Action should not exceed 100 kB. The larger the size, the more latency is introduced, which may have an impact on the performance of your system. This size limit does not include any `npm` modules that may be referenced as part of any `require` statements.

## Actions Modules

* Each Action Module can have dependencies to NPM Modules, but not to other Action Modules.

## Account Linking (setPrimaryUser)

* `primary_user_id` is limited to 128 characters
Expand All @@ -24,16 +32,6 @@ The following limitations exist when using Actions:
* The cache should be available for all Actions in the same trigger for a single execution reliably, however for subsequent executions (such as a different flow, another user login, or a user returning from a redirect action) it is not guaranteed.
* Actions that perform an Execution that yields back (such as a redirect) may result in subsequent actions being scheduled on a separate instance with a different cache state. Cached data could be inconsistent from one Action to the next even if it is the same execution.

## Dependencies

* Each Action may have a maximum of 10 `npm` modules.

## Entity limits

* Each tenant may have a maximum of 100 Actions (including both deployed and undeployed). When an Action is deleted, it no longer counts toward the limit.
* Each Action may have a maximum of 50 associated versions (both draft and active). Once the limit is reached, every additional version that is added will result in the oldest version being deleted.
* Each trigger may have a maximum of 20 active bound Actions.

## Executions

* Each execution of a trigger must complete in 20 seconds or less or the processing will end in an error. Limiting HTTP requests is the best way to keep within this time limit.
Expand All @@ -51,7 +49,6 @@ The following limitations exist when using Actions:

## Secrets

* Each Action may have a maximum of 30 secrets.
* Each secret key may have a maximum length of 128 characters.
* Each secret value may have a maximum length of 4096 characters.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
description: Describes how to share functions between Actions.
title: Actions Modules
sidebarTitle: Overview
---
<Warning>
Actions Modules is currently available in Early Access. By using this feature, you agree to the applicable Free Trial terms in Okta’s [Master Subscription Agreement](https://www.okta.com/legal/). To learn more about Auth0’s release stages, read [Product Release Stages](/docs/troubleshoot/product-lifecycle/product-release-stages).
</Warning>

Actions Modules allow you to create, manage, and share reusable code across different Actions within your Auth0 Tenant.

Previously, each Action operated independently, making it difficult to share common functions between them without using external dependencies like NPM Modules. With Actions Modules, now it's possible to:

* Create custom modules with functions hosted by Auth0.
* Use the functions defined at each custom module within one or more Actions.
* Each custom module can define independent secrets and add dependencies to NPM modules.

To learn more about writing Actions with Actions Modules, read [Write Your First Action Module](/docs/customize/actions/modules/write-your-first-action-module).

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
Actions Modules are not bound to a particular Trigger or Action type, therefore the functions defined them can be reused across Actions bound to different Triggers.
</Callout>

To learn more about Actions Modules Limitations, read [Actions Limitations](/docs/customize/actions/limitations).

## Performance

By adopting Action Modules according to the [Coding Guidelines](/docs/customize/actions/action-coding-guidelines), you can improve execution performance by sharing and reusing objects that have a costly instantiation process.

<Callout icon="file-lines" color="#0EA5E9" iconType="regular">
However, the improvement is not guaranteed, as it depends on the specific use case, the implementation, and the load and frequency of executions.
</Callout>
Loading