gbv / login-server

Login and connect accounts with multiple identity providers
https://coli-conc.gbv.de/login/
MIT License
31 stars 32 forks source link

Add CBS/PSI strategy #80

Open nichtich opened 3 years ago

nichtich commented 3 years ago

To authentificate against the CBS library system.

Basically it's a simple HTTP request

POST https://kxp.k10plus.de/login/LOGIN
USER_KEY=...
PASSWORD=...

And inspect the returned Header

X-PSI-Context: LOGIN_REJECT

or

X-PSI-Context: RELOCATE

followed by

X-PSI-Context: MAIN

The user name is hidden in the response XML (XML interface) or HTML (HTML interface).

Configuration via base URL (e.g. https://kxp.k10plus.de/)

{
   "strategy": "psi",
   "name": "Gemeinsamer Verbundkatalog (GVK)",
   "url": "https://kxp.k10plus.de/"
}

URL for the POST request and user URI template can be derived from url as {url}/login/LOGIN and {url}/user/{id} (the latter not supported as URL by PSI but can be used as URI).

nichtich commented 1 year ago

This includes two use cases

The latter checks given username & password and returns the library (for instance http://uri.gbv.de/organization/isil/DE-7), the account belongs to, so individual accounts are anonymous. Login might be required to be protected against brute-force attack.