Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 95ae2c74cf |
@@ -41,6 +41,25 @@ public static class Api
|
||||
options.Scope.Add("openid");
|
||||
options.Scope.Add("profile");
|
||||
options.Scope.Add("email");
|
||||
|
||||
options.Events = new OpenIdConnectEvents
|
||||
{
|
||||
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,
|
||||
};
|
||||
|
||||
context.ProtocolMessage.RedirectUri = uriBuilder.Uri.ToString();
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
return services;
|
||||
|
||||
Reference in New Issue
Block a user