PortalService class

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.

Constructors

PortalService()

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(String currentPassword, String newPassword) Future<void>
Changes the user's NTUT Portal password.
getAvatar([String? filename]) Future<Uint8List>
Downloads a user's avatar from NTUT Portal.
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(PortalServiceCode 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