설정
모두 선택 항목입니다. 기본값으로 충분하면 아무것도 설정하지 않아도 됩니다.
설정 항목
섹션 제목: “설정 항목”| 설정 | 타입 | 기본값 | 설명 |
|---|---|---|---|
| 요청 제한 시간 | 숫자 (초) | 10 | 연결과 읽기 제한 시간. Java sejongpeia.timeout-seconds, Python timeout_seconds, Node.js timeoutSeconds |
| 포털 로그인 재시도 횟수 | 숫자 | 3 | Java sejongpeia.max-retry, Python max_retry, Node.js maxRetry |
| 인증서 검증 | boolean | true |
Java sejongpeia.ssl-verification, Python ssl_verification, Node.js sslVerification |
재시도의 범위
섹션 제목: “재시도의 범위”- 재시도는 포털 로그인 요청에만 적용됩니다. 2xx가 아닌 응답과 시간 초과 때 다시 시도합니다.
- 마지막 시도가 시간 초과면
CONNECTION_TIMEOUT, 횟수를 모두 쓰면CONNECTION_FAILED입니다. - 포털이 틀린 비밀번호나 잠금으로 거부한 로그인은 재시도하지 않습니다. 계정을 지키기 위해서입니다.
인증서 검증
섹션 제목: “인증서 검증”기본은 켜짐입니다. 끄는 옵션은 있지만 디버깅 용도로만 생각하세요. 끄면 로그인 정보가 가는 연결을 검증하지 않습니다.
Java: Spring 없이 쓰기
섹션 제목: “Java: Spring 없이 쓰기”Spring Boot는 선택 의존성이라 일반 Java 프로젝트는 받지 않습니다. 직접 객체를 엮어 쓰세요.
import kr.suhsaechan.sejongpeia.auth.client.SejongPortalClient;import kr.suhsaechan.sejongpeia.auth.client.SejongSisClient;import kr.suhsaechan.sejongpeia.auth.model.SejongAuthResult;import kr.suhsaechan.sejongpeia.auth.parser.SejongClassicReadingParser;import kr.suhsaechan.sejongpeia.auth.parser.SejongSisParser;import kr.suhsaechan.sejongpeia.auth.parser.SejongStudentInfoParser;import kr.suhsaechan.sejongpeia.auth.service.SuhSejongAuthEngine;import kr.suhsaechan.sejongpeia.common.config.SejongAuthProperties;import kr.suhsaechan.sejongpeia.common.util.SejongTlsSupport;
SejongTlsSupport.ensureLegacyCipherEnabled(); // main() 맨 앞, 다른 HTTPS 호출보다 먼저SejongAuthProperties properties = new SejongAuthProperties();SuhSejongAuthEngine engine = new SuhSejongAuthEngine(new SejongPortalClient(properties), new SejongStudentInfoParser(), new SejongClassicReadingParser(), new SejongSisClient(properties), new SejongSisParser());SejongAuthResult result = engine.authenticate(studentId, password);공개 데이터 클라이언트
섹션 제목: “공개 데이터 클라이언트”학교 공개 데이터(SejongPublicData)의 캐시 시간, 실패 기억 시간, 캐시 최대 개수 같은 설정은 공통 규칙에 있습니다.
예시 코드
섹션 제목: “예시 코드”sejongpeia: timeout-seconds: 10 # 요청 제한 시간 (기본 10) max-retry: 3 # 포털 로그인 재시도 횟수 (기본 3) ssl-verification: true # 포털 인증서 검증 (기본 true)from sejongpeia import SejongAuthClient
# 기본값과 다른 설정이 필요할 때만 직접 만들기client = SejongAuthClient(timeout_seconds=10, max_retry=3, ssl_verification=True)result = client.authenticate(student_id, password)import { SejongAuthClient } from 'pro-sejongpeia';
// 기본값과 다른 설정이 필요할 때만 직접 만들기const client = new SejongAuthClient({ timeoutSeconds: 10, maxRetry: 3, sslVerification: true });const result = await client.authenticate(studentId, password);