auth0 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/src/auth/idToken.js +22 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## [v3.6.0](https://github.com/auth0/node-auth0/tree/v3.6.0) (2023-07-18)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/auth0/node-auth0/compare/v3.5.0...v3.6.0)
|
|
6
|
+
|
|
7
|
+
**Added**
|
|
8
|
+
|
|
9
|
+
- Support Organization Name [\#884](https://github.com/auth0/node-auth0/pull/884) ([frederikprijck](https://github.com/frederikprijck))
|
|
10
|
+
|
|
11
|
+
**Changed**
|
|
12
|
+
|
|
13
|
+
- Do not lowercase org_name claim [\#887](https://github.com/auth0/node-auth0/pull/887) ([frederikprijck](https://github.com/frederikprijck))
|
|
14
|
+
|
|
3
15
|
## [v3.5.0](https://github.com/auth0/node-auth0/tree/v3.5.0) (2023-06-26)
|
|
4
16
|
|
|
5
17
|
[Full Changelog](https://github.com/auth0/node-auth0/compare/v3.4.0...v3.5.0)
|
package/package.json
CHANGED
package/src/auth/idToken.js
CHANGED
|
@@ -84,14 +84,28 @@ const validate = function (token, options) {
|
|
|
84
84
|
|
|
85
85
|
// Organization
|
|
86
86
|
if (options.organization) {
|
|
87
|
-
if (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
if (options.organization.indexOf('org_') === 0) {
|
|
88
|
+
if (!payload.org_id || typeof payload.org_id !== 'string') {
|
|
89
|
+
throw new Error('Organization Id (org_id) claim must be a string present in the ID token');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (payload.org_id !== options.organization) {
|
|
93
|
+
throw new Error(
|
|
94
|
+
`Organization Id (org_id) claim value mismatch in the ID token; expected "${options.organization}", found "${payload.org_id}"'`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
if (!payload.org_name || typeof payload.org_name !== 'string') {
|
|
99
|
+
throw new Error(
|
|
100
|
+
'Organization Name (org_name) claim must be a string present in the ID token'
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (payload.org_name !== options.organization.toLowerCase()) {
|
|
105
|
+
throw new Error(
|
|
106
|
+
`Organization Name (org_name) claim value mismatch in the ID token; expected "${options.organization}", found "${payload.org_name}"'`
|
|
107
|
+
);
|
|
108
|
+
}
|
|
95
109
|
}
|
|
96
110
|
}
|
|
97
111
|
|