Skip to content

Authentication methods

These are the operations that log in to the portal with a student ID and password. The three languages have the same features and the same results; only the naming differs.

Names follow Python; Java and Node.js use camelCase (includeRaw, includeExtra). Node.js takes options as an object in the last argument ({ includeRaw: true }).

Parameter Type Required Default Meaning
student_id string yes Student ID. If blank, INVALID_INPUT before any network call
password string yes Portal password. If blank, INVALID_INPUT
year 4-digit number or string business periods only Year to look up
month 1-12 or empty no empty (whole year) Month to look up. Business periods only
include_raw boolean no false If true, keeps the school’s raw response (raw_html, raw_json) in the result. Extension: Raw response and extra options
include_extra boolean no false If true, puts the remaining unnamed SIS fields in extra. Extension: Raw response and extra options
Operation Java Python Node.js
Integrated: student info + classic reading + contact authenticate(id, pw) authenticate(id, pw) authenticate(id, pw)
DHC: student info + classic reading authenticateWithDHC(id, pw) authenticate_dhc(id, pw) authenticateDhc(id, pw)
SIS: student info + contact authenticateWithSIS(id, pw) authenticate_sis(id, pw) authenticateSis(id, pw)
SIS academic business periods (login required) fetchSisBusinessPeriods(id, pw, year, month) fetch_sis_business_periods(id, pw, year, month="") fetchSisBusinessPeriods(id, pw, { year, month })
Include raw response (debugging) authenticateWithRaw, authenticateWithDHCRaw, authenticateWithSISRaw include_raw=True { includeRaw: true }
Include the remaining SIS fields authenticate(id, pw, false, true) include_extra=True { includeExtra: true }
  • In Java these are methods of the SuhSejongAuthEngine bean that Spring Boot auto-configuration registers. For use without Spring see Configuration.
  • In Python the module functions (from sejongpeia import authenticate) use a client with default settings. Create a SejongAuthClient yourself to change them.
  • In Node.js every method returns a Promise. Python and Java calls are synchronous.

Part of an integrated result. The example uses Python snake_case names; Java and Node.js use camelCase (studentId, phoneNumber). All fields are on Result fields.

{
"success": true,
"student_id": "20000000",
"name": "홍길동",
"major": "컴퓨터공학과",
"email": "user@example.com",
"phone_number": "010-0000-0000"
}
Method Always filled If it fails
Integrated Student info and classic reading from DHC If the DHC step fails, the whole call fails
Integrated (contact etc.) Email, phone number, English name and school codes from SIS If the SIS step fails the call still succeeds and only those fields are null
Integrated (parent unit) parentUnitName from the portal main page If the portal main step fails the call still succeeds and the field is null
DHC Student info, classic reading Throws
SIS Student info, contact, school codes (grade and status are always empty strings) Throws
Business periods List of periods allowed per business Throws, without retry
  • A blank student ID or password is INVALID_INPUT; a wrong password is AUTHENTICATION_FAILED. All codes are on Error codes.
  • The integrated call logs in to the portal once and uses the same session for DHC, SIS and the portal main page. Calling student info and contact separately logs in twice, so prefer the one integrated call.
  • A wrong password is not retried: the call stops at the first failure. See Login verdict and account lock protection for why.
  • Most of the time is the portal’s own response time, which varies with the school server.
SejongAuthResult result = sejongAuthEngine.authenticate(studentId, password);
System.out.println(result.getName() + " " + result.getMajor());