Moved back to default redirect uri
This commit is contained in:
@@ -16,7 +16,7 @@ public class Google : EndpointGroupBase
|
|||||||
await context.ChallengeAsync(GoogleDefaults.AuthenticationScheme,
|
await context.ChallengeAsync(GoogleDefaults.AuthenticationScheme,
|
||||||
new AuthenticationProperties
|
new AuthenticationProperties
|
||||||
{
|
{
|
||||||
RedirectUri = "/o/google/callback",
|
RedirectUri = "/signin-google",
|
||||||
ExpiresUtc = DateTimeOffset.UtcNow.AddDays(30),
|
ExpiresUtc = DateTimeOffset.UtcNow.AddDays(30),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,12 +52,8 @@ builder.Services.AddInfrastructureServices(builder.Configuration);
|
|||||||
builder.Services.AddWebServices();
|
builder.Services.AddWebServices();
|
||||||
|
|
||||||
// OAuth
|
// OAuth
|
||||||
builder.Services.AddAuthentication(options =>
|
builder.Services.AddAuthentication()
|
||||||
{
|
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme,options =>
|
||||||
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
|
|
||||||
options.DefaultChallengeScheme = GoogleDefaults.AuthenticationScheme;
|
|
||||||
})
|
|
||||||
.AddCookie(options =>
|
|
||||||
{
|
{
|
||||||
options.Cookie.Name = "Hutopy";
|
options.Cookie.Name = "Hutopy";
|
||||||
options.Cookie.SecurePolicy = builder.Environment.IsDevelopment() ? CookieSecurePolicy.None : CookieSecurePolicy.Always;
|
options.Cookie.SecurePolicy = builder.Environment.IsDevelopment() ? CookieSecurePolicy.None : CookieSecurePolicy.Always;
|
||||||
@@ -70,7 +66,7 @@ builder.Services.AddAuthentication(options =>
|
|||||||
{
|
{
|
||||||
options.ClientId = builder.Configuration["Google:ClientId"] ?? throw new ArgumentNullException("The Google ClientId is missing.");
|
options.ClientId = builder.Configuration["Google:ClientId"] ?? throw new ArgumentNullException("The Google ClientId is missing.");
|
||||||
options.ClientSecret = builder.Configuration["Google:ClientSecret"] ?? throw new ArgumentNullException("The Google ClientSecret is missing.");
|
options.ClientSecret = builder.Configuration["Google:ClientSecret"] ?? throw new ArgumentNullException("The Google ClientSecret is missing.");
|
||||||
options.CallbackPath = "/o/google/callback";
|
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
|
||||||
options.Events.OnRedirectToAuthorizationEndpoint = context =>
|
options.Events.OnRedirectToAuthorizationEndpoint = context =>
|
||||||
{
|
{
|
||||||
context.Response.Redirect(context.RedirectUri + "&prompt=consent");
|
context.Response.Redirect(context.RedirectUri + "&prompt=consent");
|
||||||
|
|||||||
Reference in New Issue
Block a user