Skip to content

Commit

Permalink
show code changes performed
Browse files Browse the repository at this point in the history
  • Loading branch information
patkub committed Jul 22, 2024
1 parent e60e648 commit 0137aea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
# auth0-rule-as-action

## NOTE: This is an experimental work-in-progress!
Run an Auth0 Rule as an Action

This is just a proof-of-concept and is barely useable in its current state.
📦 NPM: https://www.npmjs.com/package/auth0-rule-as-action

NPM: https://www.npmjs.com/package/auth0-rule-as-action
## Experimental

This is an experiment with a very small feature set.

### Currently supported features
- `callback` method with success and error
- ID and Access token claims
- `context.idToken["claim"] = "value"` becomes `api.idToken.setCustomClaim(claim, value)`
- `context.accessToken["claim"] = "value"` becomes `api.accessToken.setCustomClaim(claim, value)`
- SAML configuration mappings
- `context.samlConfiguration.mappings["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"] = "upn";` becomes `api.samlResponse.setAttribute("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", "upn");`

```diff
-context.idToken["claim"] = "value"
+api.idToken.setCustomClaim(claim, value)

-context.accessToken["claim"] = "value"
+api.accessToken.setCustomClaim(claim, value)

-context.samlConfiguration.mappings["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"] = "upn";
+api.samlResponse.setAttribute("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier", "upn");
```

## Example

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth0-rule-as-action",
"version": "0.1.24",
"version": "0.2.0",
"description": "Run an Auth0 Rule as an Action",
"main": "dist/RuleToAction.js",
"scripts": {
Expand Down

0 comments on commit 0137aea

Please sign in to comment.