diff --git a/BFF/v4/DPoP/DPoP.Api/DPoP/ConfigureJwtBearerOptions.cs b/BFF/v4/DPoP/DPoP.Api/DPoP/ConfigureJwtBearerOptions.cs index 3e00f71c..77c2340b 100644 --- a/BFF/v4/DPoP/DPoP.Api/DPoP/ConfigureJwtBearerOptions.cs +++ b/BFF/v4/DPoP/DPoP.Api/DPoP/ConfigureJwtBearerOptions.cs @@ -19,18 +19,23 @@ public void PostConfigure(string name, JwtBearerOptions options) { if (_configScheme == name) { - if (options.EventsType != null && !typeof(DPoPJwtBearerEvents).IsAssignableFrom(options.EventsType)) + var dpopEventsType = typeof(DPoPJwtBearerEvents); + if (options.EventsType != null && !dpopEventsType.IsAssignableFrom(options.EventsType)) { throw new Exception("EventsType on JwtBearerOptions must derive from DPoPJwtBearerEvents to work with the DPoP support."); } - if (options.Events != null && !typeof(DPoPJwtBearerEvents).IsAssignableFrom(options.Events.GetType())) - { - throw new Exception("Events on JwtBearerOptions must derive from DPoPJwtBearerEvents to work with the DPoP support."); - } - if (options.Events == null && options.EventsType == null) + if (!dpopEventsType.IsInstanceOfType(options.Events)) { - options.EventsType = typeof(DPoPJwtBearerEvents); + if (typeof(JwtBearerEvents) == options.Events.GetType()) + { + // Default scenario where the events type wasn't overridden? + options.EventsType = dpopEventsType; + } + else + { + throw new Exception("Events on JwtBearerOptions must derive from DPoPJwtBearerEvents to work with the DPoP support."); + } } } } diff --git a/BFF/v4/DPoP/DPoP.Bff/wwwroot/app.js b/BFF/v4/DPoP/DPoP.Bff/wwwroot/app.js index 17460cb3..4d1eb8b4 100644 --- a/BFF/v4/DPoP/DPoP.Bff/wwwroot/app.js +++ b/BFF/v4/DPoP/DPoP.Bff/wwwroot/app.js @@ -1,5 +1,5 @@ const loginUrl = "/bff/login"; -const silentLoginUrl = "/bff/silent-login"; +const silentLoginUrl = "/bff/login?prompt=none"; const userUrl = "/bff/user"; const localApiUrl = "/local"; const remoteApiUrl = "/api"; @@ -224,7 +224,7 @@ function silentLogin(iframeSelector) { // we can either just treat this like a "not logged in" resolve(false); // or we can trigger an error, so someone can look into the reason why - // reject(new Error("timed_out")); + // reject(new Error("timed_out")); }, timeout); // send the iframe to the silent login endpoint to kick off the workflow diff --git a/BFF/v4/OpenApi/OpenApi.Bff/wwwroot/app.js b/BFF/v4/OpenApi/OpenApi.Bff/wwwroot/app.js index 8c59762a..60e4e173 100644 --- a/BFF/v4/OpenApi/OpenApi.Bff/wwwroot/app.js +++ b/BFF/v4/OpenApi/OpenApi.Bff/wwwroot/app.js @@ -1,5 +1,5 @@ const loginUrl = "/bff/login"; -const silentLoginUrl = "/bff/silent-login"; +const silentLoginUrl = "/bff/login?prompt=none"; const userUrl = "/bff/user"; const apiUrl = "/api1/weatherforecastFahrenheit"; let logoutUrl = "/bff/logout"; @@ -148,7 +148,7 @@ function silentLogin(iframeSelector) { // we can either just treat this like a "not logged in" resolve(false); // or we can trigger an error, so someone can look into the reason why - // reject(new Error("timed_out")); + // reject(new Error("timed_out")); }, timeout); // send the iframe to the silent login endpoint to kick off the workflow diff --git a/BFF/v4/TokenExchange/TokenExchange.Bff/wwwroot/app.js b/BFF/v4/TokenExchange/TokenExchange.Bff/wwwroot/app.js index 5f68c3a6..9ac9574b 100644 --- a/BFF/v4/TokenExchange/TokenExchange.Bff/wwwroot/app.js +++ b/BFF/v4/TokenExchange/TokenExchange.Bff/wwwroot/app.js @@ -1,5 +1,5 @@ const loginUrl = "/bff/login"; -const silentLoginUrl = "/bff/silent-login"; +const silentLoginUrl = "/bff/login?prompt=none"; const userUrl = "/bff/user"; const localApiUrl = "/local"; const remoteApiUrl = "/api"; @@ -165,7 +165,7 @@ function silentLogin(iframeSelector) { // we can either just treat this like a "not logged in" resolve(false); // or we can trigger an error, so someone can look into the reason why - // reject(new Error("timed_out")); + // reject(new Error("timed_out")); }, timeout); // send the iframe to the silent login endpoint to kick off the workflow