strapi-plugin-oidc 1.9.4 → 1.9.6
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/server/index.js +7 -3
- package/dist/server/index.mjs +7 -3
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -59,7 +59,8 @@ const errorMessages = {
|
|
|
59
59
|
WHITELIST_NOT_PRESENT: "Not present in whitelist",
|
|
60
60
|
PROVIDER_RESPONSE_INVALID: "Unexpected response from OIDC provider",
|
|
61
61
|
SESSION_MANAGER_UNSUPPORTED: "sessionManager is not supported. Please upgrade to Strapi v5.24.1 or later.",
|
|
62
|
-
|
|
62
|
+
OIDC_ISSUER_NOT_CONFIGURED: "[strapi-plugin-oidc] OIDC_ISSUER is not configured — discovery skipped. OIDC sign-in will fail until OIDC_ISSUER is set in your plugin config.",
|
|
63
|
+
JWKS_URI_NOT_CONFIGURED: "[strapi-plugin-oidc] OIDC_JWKS_URI is not configured — ID token signature verification is disabled. Set OIDC_JWKS_URI and OIDC_ISSUER from your provider's discovery document.",
|
|
63
64
|
ENFORCE_MIDDLEWARE_ERROR: "Error checking OIDC enforcement in middleware:",
|
|
64
65
|
ENFORCE_SYNC_ERROR: "[strapi-plugin-oidc] Failed to sync OIDC_ENFORCE to database:",
|
|
65
66
|
DEFAULT_ROLE_INIT_ERROR: "Could not initialize default OIDC role:",
|
|
@@ -207,7 +208,10 @@ const FIELD_MAP = [
|
|
|
207
208
|
async function applyDiscovery(strapi2) {
|
|
208
209
|
const config2 = strapi2.config.get("plugin::strapi-plugin-oidc");
|
|
209
210
|
const issuer = config2.OIDC_ISSUER;
|
|
210
|
-
if (!issuer)
|
|
211
|
+
if (!issuer) {
|
|
212
|
+
strapi2.log.warn(errorMessages.OIDC_ISSUER_NOT_CONFIGURED);
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
211
215
|
let discoveryUrl;
|
|
212
216
|
let canonicalIssuer;
|
|
213
217
|
if (issuer.includes(OIDC_DISCOVERY_PATH)) {
|
|
@@ -230,7 +234,7 @@ async function applyDiscovery(strapi2) {
|
|
|
230
234
|
);
|
|
231
235
|
return;
|
|
232
236
|
}
|
|
233
|
-
const updates = { OIDC_ISSUER: canonicalIssuer };
|
|
237
|
+
const updates = { OIDC_ISSUER: doc.issuer ?? canonicalIssuer };
|
|
234
238
|
for (const [docField, configKey] of FIELD_MAP) {
|
|
235
239
|
if (doc[docField]) {
|
|
236
240
|
updates[configKey] = doc[docField];
|
package/dist/server/index.mjs
CHANGED
|
@@ -53,7 +53,8 @@ const errorMessages = {
|
|
|
53
53
|
WHITELIST_NOT_PRESENT: "Not present in whitelist",
|
|
54
54
|
PROVIDER_RESPONSE_INVALID: "Unexpected response from OIDC provider",
|
|
55
55
|
SESSION_MANAGER_UNSUPPORTED: "sessionManager is not supported. Please upgrade to Strapi v5.24.1 or later.",
|
|
56
|
-
|
|
56
|
+
OIDC_ISSUER_NOT_CONFIGURED: "[strapi-plugin-oidc] OIDC_ISSUER is not configured — discovery skipped. OIDC sign-in will fail until OIDC_ISSUER is set in your plugin config.",
|
|
57
|
+
JWKS_URI_NOT_CONFIGURED: "[strapi-plugin-oidc] OIDC_JWKS_URI is not configured — ID token signature verification is disabled. Set OIDC_JWKS_URI and OIDC_ISSUER from your provider's discovery document.",
|
|
57
58
|
ENFORCE_MIDDLEWARE_ERROR: "Error checking OIDC enforcement in middleware:",
|
|
58
59
|
ENFORCE_SYNC_ERROR: "[strapi-plugin-oidc] Failed to sync OIDC_ENFORCE to database:",
|
|
59
60
|
DEFAULT_ROLE_INIT_ERROR: "Could not initialize default OIDC role:",
|
|
@@ -201,7 +202,10 @@ const FIELD_MAP = [
|
|
|
201
202
|
async function applyDiscovery(strapi2) {
|
|
202
203
|
const config2 = strapi2.config.get("plugin::strapi-plugin-oidc");
|
|
203
204
|
const issuer = config2.OIDC_ISSUER;
|
|
204
|
-
if (!issuer)
|
|
205
|
+
if (!issuer) {
|
|
206
|
+
strapi2.log.warn(errorMessages.OIDC_ISSUER_NOT_CONFIGURED);
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
205
209
|
let discoveryUrl;
|
|
206
210
|
let canonicalIssuer;
|
|
207
211
|
if (issuer.includes(OIDC_DISCOVERY_PATH)) {
|
|
@@ -224,7 +228,7 @@ async function applyDiscovery(strapi2) {
|
|
|
224
228
|
);
|
|
225
229
|
return;
|
|
226
230
|
}
|
|
227
|
-
const updates = { OIDC_ISSUER: canonicalIssuer };
|
|
231
|
+
const updates = { OIDC_ISSUER: doc.issuer ?? canonicalIssuer };
|
|
228
232
|
for (const [docField, configKey] of FIELD_MAP) {
|
|
229
233
|
if (doc[docField]) {
|
|
230
234
|
updates[configKey] = doc[docField];
|
package/package.json
CHANGED