From 8ace0f4d9a0c0305c90d637c3e3710989688503c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=EC=98=81?= Date: Wed, 22 Jul 2026 12:30:34 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=EC=8B=9C=20SSO?= =?UTF-8?q?=20=EC=84=B8=EC=85=98=20=EC=BF=A0=ED=82=A4=20=EC=A0=95=EB=A6=AC?= =?UTF-8?q?=20=EB=B0=8F=20=ED=8C=A8=ED=82=A4=EC=A7=80=20=EB=A9=94=ED=83=80?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 자동 로그인(EnableAutoLogin) 시 WebView2 프로필의 SSO 세션 쿠키를 먼저 정리한다. baronsso.dat이 없는데도 남은 세션 쿠키로 authorize가 즉시 통과되어 로그인 창이 뜨지 않고 바로 로그인되던 문제를 막는다. - 주기 인증은 RefreshTokenDestroyed 콜백이 설정된 경우에만 수행한다. - NuGet 패키지 메타데이터(Version 1.0.1, PackageId, Authors/Company) 추가. - 샘플 앱에 PostLogoutRedirectUri 지정 및 불필요 using 정리. Co-Authored-By: Claude Opus 4.8 (1M context) --- BaronSoftware.SSO.Sample/MainWindow.xaml.cs | 11 +++++------ BaronSoftware.SSO/BaronSSO.cs | 6 ++++++ BaronSoftware.SSO/BaronSSOOption.cs | 1 - BaronSoftware.SSO/BaronSoftware.SSO.csproj | 4 ++++ 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/BaronSoftware.SSO.Sample/MainWindow.xaml.cs b/BaronSoftware.SSO.Sample/MainWindow.xaml.cs index 8bfa1ff..7f9e00c 100644 --- a/BaronSoftware.SSO.Sample/MainWindow.xaml.cs +++ b/BaronSoftware.SSO.Sample/MainWindow.xaml.cs @@ -25,12 +25,11 @@ namespace BaronSoftware.SSO.Sample var option = new BaronSSOOption() { - Authority = _settings.Oidc.Authority, - ClientId = _settings.Oidc.ClientId, - RedirectUri = _settings.Oidc.RedirectUri, - ExtraUserValidator = new SimpleUserValidator(), - LicenseCheckInterval = 15, - RefreshTokenDestroyed = () => { MessageBox.Show("토큰이 끊겼습니다. 다시 로그인 하세요"); }, + Authority = "https://app.brsw.kr/oidc", + ClientId = "16d5f1b3-dd42-43be-87f0-5e18c0e12c6e", + RedirectUri = "http://localhost:9090/eg-bim/drawer/auth/callback", + PostLogoutRedirectUri = "http://localhost:9090/eg-bim/drawer/logout/callback", + ExtraUserValidator = new SimpleUserValidator() }; _license = new BaronSSO(option); diff --git a/BaronSoftware.SSO/BaronSSO.cs b/BaronSoftware.SSO/BaronSSO.cs index de4cc07..71c081f 100644 --- a/BaronSoftware.SSO/BaronSSO.cs +++ b/BaronSoftware.SSO/BaronSSO.cs @@ -68,7 +68,10 @@ namespace BaronSoftware.SSO { UserInfo? user = null; if (option.EnableAutoLogin) + { user = UserInfo.FromSsoFile(); + await LoginWindow.ClearSessionCookiesAsync(); + } await SignInAsync(user?.RefreshToken); } @@ -161,6 +164,9 @@ namespace BaronSoftware.SSO licenseCheckScheduler = new Schedule(async () => { + if (option.RefreshTokenDestroyed == null) + return; + // 오프라인의 경우 주기적인 인증을 무시한다. // 단, 언제든 온라인 상태가 될 수 있으니 주기 인증을 멈추지는 않는다. var isOnline = await CheckConnection(); diff --git a/BaronSoftware.SSO/BaronSSOOption.cs b/BaronSoftware.SSO/BaronSSOOption.cs index 61068e3..d45006b 100644 --- a/BaronSoftware.SSO/BaronSSOOption.cs +++ b/BaronSoftware.SSO/BaronSSOOption.cs @@ -68,7 +68,6 @@ namespace BaronSoftware.SSO } } - public Action RefreshTokenDestroyed { get; set; } } } diff --git a/BaronSoftware.SSO/BaronSoftware.SSO.csproj b/BaronSoftware.SSO/BaronSoftware.SSO.csproj index 2150b8c..76a65f5 100644 --- a/BaronSoftware.SSO/BaronSoftware.SSO.csproj +++ b/BaronSoftware.SSO/BaronSoftware.SSO.csproj @@ -6,6 +6,10 @@ enable true True + 1.0.1 + BaronSoftware.SSO + Baron 기술개발센터 + Baron 기술개발센터