I have a simple login which using standart login with Gmail Login
For the login it's success but how to add time expiration when im using google Oauth
I Have set the configuration on program but didn't work
builder.Services
.AddAuthentication(options =>
{
//options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
//options.DefaultChallengeScheme = GoogleDefaults.AuthenticationScheme;
options.DefaultScheme = "Application";
options.DefaultSignInScheme = "External";
})
.AddCookie("Application")
.AddCookie("External")
.AddGoogle(googleOptions =>
{
googleOptions.ClientId = builder.Configuration["Google:ClientId"];
googleOptions.ClientSecret = builder.Configuration["Google:ClientSecret"];
googleOptions.Events.OnRemoteFailure = (context) =>
{
context.Response.Redirect("/Account/Login");
context.HandleResponse();
return Task.CompletedTask;
};
googleOptions.SaveTokens = true;
googleOptions.CorrelationCookie.SecurePolicy = CookieSecurePolicy.Always;
});