Compare commits

...

2 Commits

Author SHA1 Message Date
Ricardo Carneiro
31ed2b3e15 Merge branch 'feat/plano-rodape' of http://git.carneiro.ddnsfree.com/ricardo/BCards into feat/plano-rodape
All checks were successful
BCards Deployment Pipeline / Run Tests (pull_request) Successful in 2s
BCards Deployment Pipeline / PR Validation (pull_request) Successful in 0s
BCards Deployment Pipeline / Build and Push Image (pull_request) Has been skipped
BCards Deployment Pipeline / Deploy to Production (ARM - OCI) (pull_request) Has been skipped
BCards Deployment Pipeline / Deploy to Staging (x86 - Local) (pull_request) Has been skipped
BCards Deployment Pipeline / Cleanup Old Resources (pull_request) Has been skipped
BCards Deployment Pipeline / Deployment Summary (pull_request) Successful in 0s
2025-08-21 18:19:42 -03:00
Ricardo Carneiro
cc6bd6299d fix: https prod 2025-08-21 18:19:12 -03:00

View File

@ -78,11 +78,21 @@ builder.Services.AddAuthentication(options =>
var msAuth = builder.Configuration.GetSection("Authentication:Microsoft"); var msAuth = builder.Configuration.GetSection("Authentication:Microsoft");
options.ClientId = msAuth["ClientId"] ?? ""; options.ClientId = msAuth["ClientId"] ?? "";
options.ClientSecret = msAuth["ClientSecret"] ?? ""; options.ClientSecret = msAuth["ClientSecret"] ?? "";
options.CallbackPath = "/signin-microsoft";
// Força seleção de conta a cada login // Força seleção de conta a cada login
options.AuthorizationEndpoint = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize"; options.AuthorizationEndpoint = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
options.TokenEndpoint = "https://login.microsoftonline.com/common/oauth2/v2.0/token"; options.TokenEndpoint = "https://login.microsoftonline.com/common/oauth2/v2.0/token";
if (!builder.Environment.IsDevelopment())
{
options.Events.OnRedirectToAuthorizationEndpoint = context =>
{
context.RedirectUri = context.RedirectUri.Replace("http://", "https://");
return Task.CompletedTask;
};
}
options.Events = new OAuthEvents options.Events = new OAuthEvents
{ {
OnRedirectToAuthorizationEndpoint = context => OnRedirectToAuthorizationEndpoint = context =>