Metadata-Version: 2.5
Name: pro-sejong-auth
Version: 1.2.21
Summary: Sejong University login API for Python: verify students with portal SSO in one line (세종대 로그인 API)
Project-URL: Homepage, https://cassiiopeia.github.io/pro-sejong-auth/
Project-URL: Source, https://github.com/Cassiiopeia/pro-sejong-auth
Project-URL: Issues, https://github.com/Cassiiopeia/pro-sejong-auth/issues
Author: Suh Saechan
License-Expression: MIT
License-File: LICENSE
Keywords: authentication,sejong,sejong-university,sso,student-verification,세종대
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: Korean
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# pro-sejong-auth (Python)

**Sejong University login API for Python** · 세종대 로그인 API

Verify a Sejong University student with a student ID and password through the portal SSO, and get their major, year, classic-reading certification and contact info. No dependencies beyond the standard library.

**[▶ Try the live demo](https://cassiiopeia.github.io/pro-sejong-auth/#demo)** · one portal login per call (about 0.8 s) · same results as the Java and Node packages · stops at the first wrong password · checked against the live portal every day

```bash
pip install pro-sejong-auth
```

```python
from sejong_auth import authenticate, SejongAuthError, ErrorCode

try:
    result = authenticate("21011234", "password")
    print(result.name, result.major, result.grade)
except SejongAuthError as error:
    if error.code == ErrorCode.AUTHENTICATION_FAILED:
        print("Wrong student ID or password")
    elif error.code == ErrorCode.ACCOUNT_LOCKED:
        print("Portal account locked: reset the password on the portal")
```

| Function | Returns |
|---|---|
| `authenticate(id, pw)` | student info + classic reading + contact (contact is `None` if that lookup fails) |
| `authenticate_dhc(id, pw, include_raw=False)` | student info + classic reading |
| `authenticate_sis(id, pw, include_raw=False)` | student info + email, phone, English name |

Settings: `SejongAuthClient(timeout_seconds=10, max_retry=3, ssl_verification=True)`.

Error codes (`error.code`): `AUTHENTICATION_FAILED`, `ACCOUNT_LOCKED`, `ACCOUNT_UNAVAILABLE`, `INVALID_INPUT`, `CONNECTION_FAILED`, `CONNECTION_TIMEOUT`, `SESSION_ERROR`, `DATA_FETCH_FAILED`, `PARSE_ERROR`, `SSL_CONFIGURATION_ERROR`. Branch on the code, not the message.

> **Account lock.** The Sejong portal locks an account after repeated wrong passwords (about 5). Only a password reset at <https://portal.sejong.ac.kr/jsp/inquiry/pwinquiry.jsp> unlocks it. The library never retries a rejected login. If anyone can type a student ID into your service, limit failed attempts per student ID.

Requires Python 3.9+. Not an official Sejong University product.

Docs, live demo and Java / Node versions: https://cassiiopeia.github.io/pro-sejong-auth/
