CACampus Auth Java

Quickstart

Build the jar, run a credential check, and read the JSON result.

The quickest path is to package the Maven project into a shaded jar. You can then run automatic fallback mode from the terminal or pass one explicit authenticator.

Requirements

  • JDK 11 or newer.
  • Maven 3.8 or newer.
  • Authorization to test the account and campus services involved.
  • No real credentials stored in shell history, source files, screenshots, issues, or logs.

Install from source

Clone the repository and run the Maven package task. The project uses the Maven Shade Plugin so the output jar includes JSoup and can be executed directly.

Shell
git clone https://github.com/UsmanovMahmudkhan/campus-auth-java.git
cd campus-auth-java
mvn clean package

The generated artifact is `target/campus-auth-java-0.2.7.jar`.

Run the CLI

Manual fallback mode is the default. It tries the configured authenticator sequence and returns the first definite authentication result.

Automatic fallback
java -jar target/campus-auth-java-0.2.7.jar <student_id> <password>

For safer local usage, omit the password and enter it at the prompt.

Interactive password
java -jar target/campus-auth-java-0.2.7.jar <student_id>

Choose a method

Use a single method when you know exactly which campus flow you want to validate. Use a comma-separated list when your application wants a smaller fallback sequence.

Selected authenticators
java -jar target/campus-auth-java-0.2.7.jar <student_id> <password> PortalSSOToken
java -jar target/campus-auth-java-0.2.7.jar <student_id> <password> PortalSSOToken,DosejongSession

Interpret the result

Do not treat every unsuccessful service interaction as an authentication failure. Check `success`, `is_auth`, and `code` separately so outages, timeouts, and parsing changes are handled correctly.

Check `success`

If `success` is false, the service flow failed before a reliable credential decision could be made.

Check `is_auth`

If it is true or false, the authenticator produced a definite credential result. If it is null, continue fallback or show an unknown state.

Use `code` for branching

Result codes are meant for program logic, logs, and user-facing error mapping.