- IUserValidator.Validate: bool 반환 → void (인증 실패 시 예외로 처리) - BaronSSOOption: Validator → ExtraUserValidator로 명명, FamilyValidator(기본 DefaultFamilyUserValidator) 추가 - DefaultFamilyUserValidator 신규: Center/Family 테넌트 사용자 통과, 그 외 InvalidUserException - BaronSSO.SignInAsync: Family/Extra 검증기 적용 흐름 정리 - InvalidUserException: UserInfo 기반 생성자 - Sample(MainWindow/SampleSettings/SimpleUserValidator) 갱신 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
54 lines
2.5 KiB
C#
54 lines
2.5 KiB
C#
using System.Globalization;
|
|
|
|
namespace BaronSoftware.SSO
|
|
{
|
|
public sealed class BaronSSOOption
|
|
{
|
|
public CultureInfo Culture { get; set; } = CultureInfo.InvariantCulture;
|
|
|
|
/// <summary>OIDC Issuer(서버 주소). 미지정 시 라이브러리 기본값을 사용합니다.</summary>
|
|
public string Authority { get; init; }
|
|
|
|
/// <summary>퍼블릭 클라이언트 ID. (Client Secret 없음 — PKCE 사용)</summary>
|
|
public string ClientId { get; init; }
|
|
|
|
/// <summary>
|
|
/// 콘솔에 등록된 인증 콜백 URL과 문자 그대로 일치해야 합니다.
|
|
/// 데스크톱 앱 전용 루프백 주소(127.0.0.1 + 고유 포트/경로)를 사용해
|
|
/// 웹 프론트(localhost:3000 등)와 충돌하지 않게 합니다.
|
|
/// 임베디드 WebView가 이동을 가로채므로 실제 서버는 띄울 필요가 없습니다.
|
|
/// </summary>
|
|
public string RedirectUri { get; init; }
|
|
|
|
/// <summary>
|
|
/// SSO 로그아웃(RP-Initiated Logout) 후 돌아올 주소입니다.
|
|
/// 콘솔에서 해당 클라이언트의 post_logout_redirect_uris에 동일하게 등록돼 있어야 합니다.
|
|
/// 미지정 시 SSO 서버 세션 종료는 생략하고 로컬 사용자 정보/세션 쿠키만 정리합니다.
|
|
/// (RedirectUri처럼 전용 루프백 주소 권장 — 임베디드 WebView가 복귀를 가로챕니다.)
|
|
/// </summary>
|
|
public string PostLogoutRedirectUri { get; init; }
|
|
|
|
/// <summary>
|
|
/// 인터넷이 안되는 상황에서도, refresh_token이 유효한 동안 로그인 인증을 유지할지 여부입니다. (기본값: true)
|
|
/// </summary>
|
|
public bool EnableOffline { get; set; } = true;
|
|
|
|
/// <summary>
|
|
/// 로그인 후, 로그인 인증은 Refresh token 유효기간 동안 유지합니다.
|
|
/// </summary>
|
|
public bool EnableAutoLogin { get; set; } = true;
|
|
|
|
private IUserValidator familyValidator;
|
|
public IUserValidator FamilyValidator
|
|
{
|
|
get => familyValidator ?? new DefaultFamilyUserValidator();
|
|
set => familyValidator = value;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 사용자 인증에 대한 추가 검증이 필요한 경우, IUserValidator 인터페이스를 구현하여 Validator 속성에 할당할 수 있습니다.
|
|
/// </summary>
|
|
public required IUserValidator? ExtraUserValidator { get; set; }
|
|
}
|
|
}
|