Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions BFF/v4/DPoP/DPoP.Api/DPoP/ConfigureJwtBearerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions BFF/v4/DPoP/DPoP.Bff/wwwroot/app.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions BFF/v4/OpenApi/OpenApi.Bff/wwwroot/app.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions BFF/v4/TokenExchange/TokenExchange.Bff/wwwroot/app.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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
Expand Down
Loading