login
Authenticate to EduPage for a school, creating or replacing the server-side session for that subdomain. Use credentials, auto-detect, or session ID; handles 2FA.
Instructions
Log in to Edupage for a school. Writes: establishes (or replaces) the server-side session for that subdomain.
Args:
username: EduPage account login. Falls back to EDUPAGE_USERNAME.
password: Account password. Falls back to EDUPAGE_PASSWORD.
subdomain: School subdomain (e.g. 'school'). Falls back to the first
value of EDUPAGE_SUBDOMAINS; for method='auto' it is optional and
tags the detected school's session.
method: How to authenticate:
- 'credentials' (default) — username/password for a known subdomain.
- 'auto' — portal auto-detect of the school (formerly login_auto).
- 'session' — build a session from an existing PHPSESSID cookie
(formerly login_from_session); pass it in session_id.
session_id: PHPSESSID cookie value, required when method='session'.
Returns:
dict with logged_in status, subdomain, user_id, role and whether 2FA
is pending. When two_factor_required is true, finish with
two_factor_finish.
Notes:
- Each login call adds/replaces that subdomain's session; call
login_all to log into several schools in one call.
- When EDUPAGE_SUBDOMAINS is set it is a strict allowlist: login into
a school outside it is refused.
- Prefer setting EDUPAGE_USERNAME / EDUPAGE_PASSWORD (and
EDUPAGE_SUBDOMAINS for multi-school) — the server then logs in
automatically at startup.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | credentials | |
| password | No | ||
| username | No | ||
| subdomain | No | ||
| session_id | No |