Skip to content

Commit

Permalink
Update Program.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Jan 21, 2024
1 parent f01ca3b commit 2b31eda
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion TechStacks/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
options.ClientSecret = Environment.GetEnvironmentVariable("GH_CLIENT_SECRET") ?? config["oauth.github.ClientSecret"]!;
options.Scope.Add("user:email");
options.CallbackPath = "/signin-oidc-github";
/*
options.Events = new OAuthEvents
{
// Force OAuth redirect as https
Expand All @@ -45,6 +46,7 @@
return Task.FromResult(0);
}
};
*/
})
.AddScheme<AuthenticationSchemeOptions,BasicAuthenticationHandler<ApplicationUser,int>>(BasicAuthenticationHandler.Scheme, null)
.AddIdentityCookies(options => options.DisableRedirectsForApis());
Expand Down Expand Up @@ -85,7 +87,10 @@

services.Configure<ForwardedHeadersOptions>(options => {
//https://github.com/aspnet/IISIntegration/issues/140#issuecomment-215135928
options.ForwardedHeaders = ForwardedHeaders.XForwardedProto;
//https://github.com/IdentityServer/IdentityServer4/issues/324#issuecomment-309021465
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
options.KnownProxies.Clear();
options.KnownProxies.Clear();
});

services.AddRazorPages();
Expand Down

0 comments on commit 2b31eda

Please sign in to comment.