ekv-project / eKV

Sistem Pengurusan Maklumat Pelajar Kolej Vokasional
https://ekv.readthedocs.io
GNU General Public License v3.0
3 stars 3 forks source link

eKV Login API #85

Open hanisirfan opened 2 years ago

hanisirfan commented 2 years ago

This feature is for v0.3.0

Create an API to allow SeaJell user to login with eKV credentials.

API request to eKV will be verified with an API key provided by eKV (use Sanctum if possible, idk if it is). This API key is bound to a hostname which is SeaJell hostname. If no API key or the hostname doesn't match with its hostname, eKV API will return an error.

The API will return with a response which consist of basic user information that SeaJell needed to function like user name, user identification number etc. The response will be saved into SeaJell database to reduce the amount of requests when regenerating e-cert for user.

The flow

  1. eKV admin enable eKV Login API feature.
  2. eKV admin generate an API key for the SeaJell hostname (for API key validation).
  3. SeaJell admin enable eKV Login API and enter eKV hostname (for API request) and API key from eKV.
  4. User tick the "Login with eKV" box on SeaJell login page which allows them to login with eKV credentials. This box will only appear when SeaJell admin enable eKV Login API.
  5. Response from the API will be stored inside a special eKV user table in SeaJell database. The data in this table will be used for eKV user e-cert.

For now idk how SeaJell e-cert addition (individual or bulk) function will work and also how other SeaJell features will work. I'll think about this later.