You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
For many people who only want to ensure https is used (instead of http) like myself as I'm running in a Docker container hosted in Azure App Service. I think a simpler option such as ForceHttpsRedirectUris = true in the configuration/options would be simpler. It would remove the need to specify the full absolute URI just to ensure https is used allowing the computed redirect URI to stay and just upgrade it to https. I'm concerned with managing the absolute URIs across configuration files and environments - relative paths as so much friendlier.
Describe the solution you'd like
Here is what I've currently done which solved my issue of http being used when in a Docker container:
services.Configure(OpenIdConnectDefaults.AuthenticationScheme,
options => {
var redirectToIdpHandler = options.Events.OnRedirectToIdentityProvider;
options.Events.OnRedirectToIdentityProvider = async context =>
{
// Call what Microsoft.Identity.Web is doing
await redirectToIdpHandler(context);
// Override the redirect URI to be what you want
if (context.ProtocolMessage?.RedirectUri?.StartsWith("http://") ?? false)
{
context.ProtocolMessage.RedirectUri = context.ProtocolMessage.RedirectUri.Replace("http://", "https://");
}
};
var redirectToIdpForSignOutHandler = options.Events.OnRedirectToIdentityProviderForSignOut;
options.Events.OnRedirectToIdentityProviderForSignOut = async context =>
{
// Call what Microsoft.Identity.Web is doing
await redirectToIdpForSignOutHandler(context);
// Override the redirect URI to be what you want
if (context.ProtocolMessage?.PostLogoutRedirectUri?.StartsWith("http://") ?? false)
{
context.ProtocolMessage.PostLogoutRedirectUri = context.ProtocolMessage.PostLogoutRedirectUri.Replace("http://", "https://");
}
};
});
Describe alternatives you've considered
Customers are not blocked as they can set the RedirectUri and PostLogoutRedirectUri
Additional context
This is a nice to have that would avoid devs maitaining multiple appsettings.json, in particular when there are several deployment slots ...
The text was updated successfully, but these errors were encountered:
Initially raised by @krispenner in #115 (comment)
Is your feature request related to a problem? Please describe.
For many people who only want to ensure https is used (instead of http) like myself as I'm running in a Docker container hosted in Azure App Service. I think a simpler option such as ForceHttpsRedirectUris = true in the configuration/options would be simpler. It would remove the need to specify the full absolute URI just to ensure https is used allowing the computed redirect URI to stay and just upgrade it to https. I'm concerned with managing the absolute URIs across configuration files and environments - relative paths as so much friendlier.
Describe the solution you'd like
Here is what I've currently done which solved my issue of http being used when in a Docker container:
services.Configure(OpenIdConnectDefaults.AuthenticationScheme,
options => {
var redirectToIdpHandler = options.Events.OnRedirectToIdentityProvider;
options.Events.OnRedirectToIdentityProvider = async context =>
{
// Call what Microsoft.Identity.Web is doing
await redirectToIdpHandler(context);
Describe alternatives you've considered
Customers are not blocked as they can set the
RedirectUri
andPostLogoutRedirectUri
Additional context
This is a nice to have that would avoid devs maitaining multiple appsettings.json, in particular when there are several deployment slots ...
The text was updated successfully, but these errors were encountered: