로그인 시 SSO 세션 쿠키 정리 및 패키지 메타데이터 추가
- 자동 로그인(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) <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -68,7 +68,6 @@ namespace BaronSoftware.SSO
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Action RefreshTokenDestroyed { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
|
||||
<Version>1.0.1</Version>
|
||||
<PackageId>BaronSoftware.SSO</PackageId>
|
||||
<Authors>Baron 기술개발센터</Authors>
|
||||
<Company>Baron 기술개발센터</Company>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user