Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get user loans from NLB website #178

Open
cliffchew84 opened this issue Nov 5, 2024 · 1 comment
Open

Get user loans from NLB website #178

cliffchew84 opened this issue Nov 5, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@cliffchew84
Copy link
Owner

Allow a way for users to get their loaned NLB books from their NLB accounts. With the current NLB API endpoints, such a flow probably requires the user to provide their login details, and then we have a way to web scrape their loaned books from their NLB website.

This might be a useful feature for users, as they may want a way to track their loaned books on NLB, but shouldn't be priority feature. Just a random inclusion as I thought about it.

@cliffchew84 cliffchew84 added the enhancement New feature or request label Nov 5, 2024
@kiritowu
Copy link
Collaborator

kiritowu commented Nov 8, 2024

AFAIK, none of the public API provide information on user specific information like Loans, Reservation etc.

Reverse engineering from NLB's official website doesnt seems feasible too because:

  1. NLB's website uses Session Based Authentication after OAuth 2.0 process. This means a session Id ASP.NET_SessionId is stored in user cookies and NLB's server for authentication purpose. Everytime the session expired, the session Id is invalid and the user needs to sign in again.
  2. Current login flow from NLB website dont seems to be easily reverse engineered. Sign-In link is dynamically generated with client-id. Scanning of QR from Singpass or NLB's App will automatically redirect user to NLB's website instead of our webapp. Also the cookie returned is http-only that cannot be accessed with JS. More research is needed on how this can be safely implemented.

An alternative option that I can propose, is to add feature for user to mark a certain book as loaned by the user. Since we can technically retrieve the loan date for a particular item, this can then satisfy the requirement for user to be notified of loaned books and their expiry date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants