Compare commits

1 Commits

2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -52,5 +52,5 @@ public class LoginModel : PageModel
public IActionResult OnPostKakao() => Challenge(BuildProps("kakao"), PortalOAuthDefaults.KakaoScheme); public IActionResult OnPostKakao() => Challenge(BuildProps("kakao"), PortalOAuthDefaults.KakaoScheme);
private static AuthenticationProperties BuildProps(string provider) => private static AuthenticationProperties BuildProps(string provider) =>
new() { RedirectUri = $"/taxbaik/portal/external-callback?provider={provider}" }; new() { RedirectUri = $"/portal/external-callback?provider={provider}" };
} }
+5 -5
View File
@@ -89,8 +89,8 @@ var authenticationBuilder = builder.Services.AddAuthentication(opts =>
opts.Cookie.HttpOnly = true; opts.Cookie.HttpOnly = true;
opts.Cookie.SameSite = SameSiteMode.Lax; opts.Cookie.SameSite = SameSiteMode.Lax;
opts.Cookie.SecurePolicy = isProduction ? CookieSecurePolicy.Always : CookieSecurePolicy.SameAsRequest; opts.Cookie.SecurePolicy = isProduction ? CookieSecurePolicy.Always : CookieSecurePolicy.SameAsRequest;
opts.LoginPath = "/taxbaik/portal/login"; opts.LoginPath = "/portal/login";
opts.AccessDeniedPath = "/taxbaik/portal/login"; opts.AccessDeniedPath = "/portal/login";
opts.SlidingExpiration = true; opts.SlidingExpiration = true;
opts.ExpireTimeSpan = TimeSpan.FromDays(7); opts.ExpireTimeSpan = TimeSpan.FromDays(7);
}) })
@@ -111,7 +111,7 @@ if (!string.IsNullOrWhiteSpace(googleClientId) && !string.IsNullOrWhiteSpace(goo
opts.SignInScheme = PortalOAuthDefaults.ExternalScheme; opts.SignInScheme = PortalOAuthDefaults.ExternalScheme;
opts.ClientId = googleClientId; opts.ClientId = googleClientId;
opts.ClientSecret = googleClientSecret; opts.ClientSecret = googleClientSecret;
opts.CallbackPath = "/taxbaik/portal/signin-google"; opts.CallbackPath = "/portal/signin-google";
}); });
} }
@@ -124,7 +124,7 @@ if (!string.IsNullOrWhiteSpace(naverClientId) && !string.IsNullOrWhiteSpace(nave
opts.SignInScheme = PortalOAuthDefaults.ExternalScheme; opts.SignInScheme = PortalOAuthDefaults.ExternalScheme;
opts.ClientId = naverClientId; opts.ClientId = naverClientId;
opts.ClientSecret = naverClientSecret; opts.ClientSecret = naverClientSecret;
opts.CallbackPath = "/taxbaik/portal/signin-naver"; opts.CallbackPath = "/portal/signin-naver";
opts.AuthorizationEndpoint = "https://nid.naver.com/oauth2.0/authorize"; opts.AuthorizationEndpoint = "https://nid.naver.com/oauth2.0/authorize";
opts.TokenEndpoint = "https://nid.naver.com/oauth2.0/token"; opts.TokenEndpoint = "https://nid.naver.com/oauth2.0/token";
opts.UserInformationEndpoint = "https://openapi.naver.com/v1/nid/me"; opts.UserInformationEndpoint = "https://openapi.naver.com/v1/nid/me";
@@ -156,7 +156,7 @@ if (!string.IsNullOrWhiteSpace(kakaoClientId) && !string.IsNullOrWhiteSpace(kaka
opts.SignInScheme = PortalOAuthDefaults.ExternalScheme; opts.SignInScheme = PortalOAuthDefaults.ExternalScheme;
opts.ClientId = kakaoClientId; opts.ClientId = kakaoClientId;
opts.ClientSecret = kakaoClientSecret; opts.ClientSecret = kakaoClientSecret;
opts.CallbackPath = "/taxbaik/portal/signin-kakao"; opts.CallbackPath = "/portal/signin-kakao";
opts.AuthorizationEndpoint = "https://kauth.kakao.com/oauth/authorize"; opts.AuthorizationEndpoint = "https://kauth.kakao.com/oauth/authorize";
opts.TokenEndpoint = "https://kauth.kakao.com/oauth/token"; opts.TokenEndpoint = "https://kauth.kakao.com/oauth/token";
opts.UserInformationEndpoint = "https://kapi.kakao.com/v2/user/me"; opts.UserInformationEndpoint = "https://kapi.kakao.com/v2/user/me";