auth0-ext-compilers
Advanced tools
Comparing version 5.4.0 to 5.5.0
@@ -5,3 +5,3 @@ | ||
``` | ||
auth0-extension-name: "client-credentials" | ||
auth0-extension-name: "credentials-exchange" | ||
``` | ||
@@ -8,0 +8,0 @@ |
@@ -7,2 +7,3 @@ 'use strict'; | ||
'password-exchange': require('./lib/compilers/password_exchange'), | ||
'post-change-password': require('./lib/compilers/user-registration'), | ||
'pre-user-registration': require('./lib/compilers/user-registration'), | ||
@@ -9,0 +10,0 @@ 'post-user-registration': require('./lib/compilers/user-registration'), |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "5.4.0", | ||
"version": "5.5.0", | ||
"description": "Webtask compilers for Auth0 platform extensibility points", | ||
@@ -11,0 +11,0 @@ "engines": { |
## This extensibility point is no longer supported in Auth0 | ||
This information is preserved here only for reference. | ||
The *password-exchange* extensibility point allows custom code to modify the scopes and add custom claims to the tokens issued from the `POST /oauth/token` Auth0 API using `grant_type=password`. | ||
@@ -34,13 +38,21 @@ | ||
{ | ||
"scope": "array of strings" | ||
// other properties with namespaced property names | ||
accessToken: { | ||
scope: ['array', 'of', 'strings'], | ||
claim1: 'value1', | ||
claim2: 'value2' | ||
}, | ||
idToken: { | ||
claimA: 'valueA', | ||
claimB: 'valueB' | ||
} | ||
} | ||
``` | ||
The result object in turn contains two (optional) properties: `accessToken` for the claims corresponding to the access_token (including the `scope` property, also optional), and `idToken` for the claims corresponding to the id_token. | ||
The `scope` property of the response as well as any other properties with names that: | ||
Please note that property names for custom claims (like `claim1` or `claimA` in the above example) have to conform with the following: | ||
* are URLs with `http` or `https` schemes | ||
* have hostnames other than `auth0.com`, `webtask.io`, `webtask.run`, or subordinate domain names | ||
* The name has to be properly namespaced, by using a valid URL with `http` or `https` schemes as prefix (for example `"https://example.com/someclaimname"`) | ||
* The hostnames of the above mentioned URL has to be other than `auth0.com`, `webtask.io`, `webtask.run`, or subordinate domain names. | ||
will be added as claims to the token being issued. All other response properties are ignored. | ||
All other response properties are ignored. | ||
@@ -71,6 +83,16 @@ #### Programming model | ||
module.exports = function (user, client, scope, audience, context, cb) { | ||
// call the callback with an error to signal authorization failure | ||
// or with a mapping of claims to values (including scopes). | ||
cb(null, { claim: 'value' }); // return error or a mapping of access token claims | ||
var accessToken = { | ||
scope: ['array', 'of', 'strings'], | ||
'http://example.com/claim1': 'value1', | ||
'http://example.com/claim2': 'value2' | ||
}; | ||
var idToken = { | ||
'http://example.com/claimA': 'valueA', | ||
'http://example.com/claimB': 'valueB' | ||
}; | ||
// (call the callback with an error as first argument to signal authorization failure if needed) | ||
cb(null, { accessToken: accessToken, idToken: idToken }); | ||
}; | ||
``` |
@@ -25,3 +25,3 @@ This repository contains [webtask compilers](https://webtask.io/docs/webtask-compilers) that enable custom programming models for Auth0 platform extensibility points. | ||
--meta auth0-extension=runtime \ | ||
--meta auth0-extension-name=client-credentials-exchange \ | ||
--meta auth0-extension-name=credentials-exchange \ | ||
--meta auth0-extension-secret=$SECRET \ | ||
@@ -73,4 +73,3 @@ --secret auth0-extension-secret=$SECRET | ||
1. [The *client-credentials-exchange* extensibility point](./client-credentials-exchange.md) | ||
2. [The *password-exchange* extensibility point](./password-exchange.md) | ||
3. [The *pre-user-registration* extensibility point](./pre-user-registration.md) | ||
2. [The *pre-user-registration* extensibility point](./pre-user-registration.md) | ||
3. [The *post-user-registration* extensibility point](./post-user-registration.md) | ||
@@ -77,0 +76,0 @@ |
@@ -17,4 +17,9 @@ /* eslint-env node, mocha */ | ||
Assert.equal(typeof Compilers['client-credentials-exchange'], 'function'); | ||
Assert.equal(typeof Compilers['password-exchange'], 'function'); | ||
Assert.equal(typeof Compilers['post-change-password'], 'function'); | ||
Assert.equal(typeof Compilers['pre-user-registration'], 'function'); | ||
Assert.equal(typeof Compilers['post-user-registration'], 'function'); | ||
Assert.equal(typeof Compilers['generic'], 'function'); | ||
}); | ||
}); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
68965
1208
0
106