Skip to content

Configuration

Everything is optional. If the defaults are fine, configure nothing.

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
  • 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 is CONNECTION_FAILED.
  • A login the portal rejected for a wrong password or a lock is never retried, to protect the account.

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.

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 call
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);

Settings of the public school data client (SejongPublicData) such as cache time, failure memory time and maximum cache entries are in Common rules.

sejongpeia:
timeout-seconds: 10 # request timeout (default 10)
max-retry: 3 # portal login retries (default 3)
ssl-verification: true # portal certificate check (default true)