Firewall and User-Agent
Why it is hard
Section titled “Why it is hard”Sometimes login works and TLS passes, yet requests fail oddly. The cause is the User-Agent request header. Two behaviors were found in the portal flow.
| Situation | Result |
|---|---|
No User-Agent sent |
classic.sejong.ac.kr answers 404 after SSO |
A library default (for example Python-urllib) |
The firewall of sjpt.sejong.ac.kr blocks it and returns an “Alert!!!” HTML page |
Your code is correct in both cases and only the response is strange, so it is easy to blame parsing or the login.
What the library does
Section titled “What the library does”It sends a non-empty, non-default, identifying User-Agent on every request. The format fixed in the contract is:
pro-sejongpeia-<language>/<version>- Python:
pro-sejongpeia-python/<version> - Node.js:
pro-sejongpeia-node/<version> - Java public data calls:
pro-sejongpeia-java - Authentication requests follow the format above.
If you implement it yourself
Section titled “If you implement it yourself”- Set a non-empty, distinctive
User-Agenton every HTTP client. - Rather than imitating a browser, leave the library name and version visible. It makes finding the cause easier for both sides when something goes wrong.
- When you get a 404 or an “Alert!!!” page, suspect the header before the parser.
- Legacy TLS
- SSO flow
- Source: spec/PORTAL_FLOW.md
