Configuration
Everything is optional. If the defaults are fine, configure nothing.
Settings
Section titled “Settings”| Setting | Type | Default | Meaning |
|---|---|---|---|
| Request timeout | number (seconds) | 10 | Connect and read timeout. Java sejongpeia.timeout-seconds, Python timeout_seconds, Node.js timeoutSeconds |
| Portal login retries | number | 3 | Java sejongpeia.max-retry, Python max_retry, Node.js maxRetry |
| Certificate verification | boolean | true |
Java sejongpeia.ssl-verification, Python ssl_verification, Node.js sslVerification |
Scope of retries
Section titled “Scope of retries”- Retries apply to the portal login request only. It is tried again on a non-2xx answer or a timeout.
- A timeout on the last attempt is
CONNECTION_TIMEOUT; running out of attempts isCONNECTION_FAILED. - A login the portal rejected for a wrong password or a lock is never retried, to protect the account.
Certificate verification
Section titled “Certificate verification”On by default. There is an option to turn it off, but treat it as a debugging tool: with it off, the connection that carries the login is not verified.
Java: without Spring
Section titled “Java: without Spring”Spring Boot is an optional dependency, so a plain Java project does not pull it in. Wire the objects yourself.
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(); // first thing in main(), before any other HTTPS callSejongAuthProperties 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);Public data client
Section titled “Public data client”Settings of the public school data client (SejongPublicData) such as cache time, failure memory time and maximum cache entries are in Common rules.
Example code
Section titled “Example code”sejongpeia: timeout-seconds: 10 # request timeout (default 10) max-retry: 3 # portal login retries (default 3) ssl-verification: true # portal certificate check (default true)from sejongpeia import SejongAuthClient
# create your own client only when you need non-default settingsclient = SejongAuthClient(timeout_seconds=10, max_retry=3, ssl_verification=True)result = client.authenticate(student_id, password)import { SejongAuthClient } from 'pro-sejongpeia';
// create your own client only when you need non-default settingsconst client = new SejongAuthClient({ timeoutSeconds: 10, maxRetry: 3, sslVerification: true });const result = await client.authenticate(studentId, password);