Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 95ae2c74cf |
@@ -42,13 +42,24 @@ public static class Api
|
|||||||
options.Scope.Add("profile");
|
options.Scope.Add("profile");
|
||||||
options.Scope.Add("email");
|
options.Scope.Add("email");
|
||||||
|
|
||||||
options.CorrelationCookie.SecurePolicy = CookieSecurePolicy.Always;
|
options.Events = new OpenIdConnectEvents
|
||||||
options.CorrelationCookie.SameSite = SameSiteMode.None;
|
{
|
||||||
options.CorrelationCookie.HttpOnly = true;
|
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,
|
||||||
|
};
|
||||||
|
|
||||||
options.NonceCookie.SecurePolicy = CookieSecurePolicy.Always;
|
context.ProtocolMessage.RedirectUri = uriBuilder.Uri.ToString();
|
||||||
options.NonceCookie.SameSite = SameSiteMode.None;
|
}
|
||||||
options.NonceCookie.HttpOnly = true;
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
},
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
|
|||||||
Reference in New Issue
Block a user