@muze-nl/metro-oidc 0.1.5 → 0.2.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/dist/browser.js +79 -50
- package/dist/browser.js.map +3 -3
- package/dist/browser.min.js +1 -1
- package/dist/browser.min.js.map +4 -4
- package/package.json +2 -2
- package/src/oidcmw.mjs +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muze-nl/metro-oidc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "oidc client middleware for @muze-nl/metro",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": [
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@muze-nl/assert": "^0.3.3",
|
|
51
51
|
"@muze-nl/metro": "^0.5.5",
|
|
52
|
-
"@muze-nl/metro-oauth2": "^0.
|
|
52
|
+
"@muze-nl/metro-oauth2": "^0.4.0"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/src/oidcmw.mjs
CHANGED
|
@@ -67,6 +67,7 @@ export default function oidcmw(options={}) {
|
|
|
67
67
|
|
|
68
68
|
// now initialize an oauth2 client stack, using options.client as default
|
|
69
69
|
// with forceAuthentication: true
|
|
70
|
+
const scope = options.scope || 'openid'
|
|
70
71
|
const oauth2Options = Object.assign(
|
|
71
72
|
{
|
|
72
73
|
site: options.issuer,
|
|
@@ -75,11 +76,12 @@ export default function oidcmw(options={}) {
|
|
|
75
76
|
oauth2_configuration: {
|
|
76
77
|
client_id: options.client_info.client_id,
|
|
77
78
|
client_secret: options.client_info.client_secret,
|
|
78
|
-
code_verifier: false, //FIXME: detect pkce support
|
|
79
79
|
grant_type: 'authorization_code',
|
|
80
|
+
response_type: 'code',
|
|
81
|
+
response_mode: 'query',
|
|
80
82
|
authorization_endpoint: options.openid_configuration.authorization_endpoint,
|
|
81
83
|
token_endpoint: options.openid_configuration.token_endpoint,
|
|
82
|
-
scope:
|
|
84
|
+
scope, //FIXME: should only use scopes supported by server
|
|
83
85
|
redirect_uri: options.client_info.redirect_uris[0] //FIXME: find the best match?
|
|
84
86
|
}
|
|
85
87
|
}
|
|
@@ -87,6 +89,7 @@ export default function oidcmw(options={}) {
|
|
|
87
89
|
)
|
|
88
90
|
|
|
89
91
|
const dpopOptions = {
|
|
92
|
+
site: options.issuer,
|
|
90
93
|
authorization_endpoint: options.openid_configuration.authorization_endpoint,
|
|
91
94
|
token_endpoint: options.openid_configuration.token_endpoint,
|
|
92
95
|
dpop_signing_alg_values_supported: options.openid_configuration.dpop_signing_alg_values_supported
|