PortalService class abstract interface

Service for authenticating with NTUT Portal and performing SSO.

This service handles:

  • User authentication (login/logout)
  • Session management
  • Single sign-on (SSO) to other NTUT services
  • User profile and avatar retrieval

All HTTP clients in the application share a single cookie jar, so logging in through this service provides authentication for all other services after calling sso for each required service.

Implementers

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

changePassword({required String newPassword, String? currentPassword, bool isExpired = false}) → Future<void>
If isExpired is true, it changes an expired password (using the expired/first-time login session). Otherwise, it performs a normal password change (from settings) and requires currentPassword.
getApplicationCatalog() → Future<List<PortalApplicationCategoryDto>>
Fetches every application category and browser-openable application available to the current portal account in Chinese and English.
getAvatar([String? filename]) → Future<Uint8List>
Downloads a user's avatar from NTUT Portal.
getCalendar(DateTime startDate, DateTime endDate) → Future<List<CalendarEventDto>>
Fetches academic calendar events within a date range.
getSsoUrl(String serviceCode) → Future<Uri>
Returns a URL that authenticates the user with a target NTUT service via OAuth2 authorization code.
login(String username, String password) → Future<UserDto>
Authenticates a user with NTUT Portal credentials.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sso(String serviceCode) → Future<void>
Performs single sign-on (SSO) to authenticate with a target NTUT service.
toString() → String
A string representation of this object.
inherited
uploadAvatar(Uint8List imageBytes, String? oldFilename) → Future<String>
Uploads a new profile photo to NTUT Portal, replacing the current one.

Operators

operator ==(Object other) → bool
The equality operator.
inherited