Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c4d3bb4cdf | |||
| 65f102f18a | |||
| cdc80db214 |
@@ -46,19 +46,13 @@ public static class Api
|
||||
{
|
||||
OnRedirectToIdentityProvider = context =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(context.ProtocolMessage.RedirectUri) && context.ProtocolMessage.RedirectUri.StartsWith("http://", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var uriBuilder = new UriBuilder(context.ProtocolMessage.RedirectUri)
|
||||
{
|
||||
Scheme = "https",
|
||||
Port = -1,
|
||||
};
|
||||
var fallbackUri = context.ProtocolMessage.RedirectUri;
|
||||
|
||||
context.ProtocolMessage.RedirectUri = uriBuilder.Uri.ToString();
|
||||
}
|
||||
if (fallbackUri.StartsWith("http://", StringComparison.OrdinalIgnoreCase))
|
||||
context.ProtocolMessage.RedirectUri = fallbackUri.Replace("http://", "https://", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
return Task.CompletedTask;
|
||||
},
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user