콘텐츠로 이동

설정

모두 선택 항목입니다. 기본값으로 충분하면 아무것도 설정하지 않아도 됩니다.

설정 타입 기본값 설명
요청 제한 시간 숫자 (초) 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입니다.
  • 포털이 틀린 비밀번호나 잠금으로 거부한 로그인은 재시도하지 않습니다. 계정을 지키기 위해서입니다.

기본은 켜짐입니다. 끄는 옵션은 있지만 디버깅 용도로만 생각하세요. 끄면 로그인 정보가 가는 연결을 검증하지 않습니다.

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)