Libki / libki-server

Libki Server
Other
55 stars 28 forks source link

Notification to external system on login/logout #347

Open jfmartinezm opened 10 months ago

jfmartinezm commented 10 months ago

In our system, when a user logs in, Libki should send a notification to an external system to perform additional tasks. This notification has to be sent over HTTP to a certain endpoint.

This feature could be implemented by creating a new module which contains the notification code (similar to /lib/Libki/LDAP.pm or SIP.pm), and calling it on successful login/logout.

kylemhall commented 10 months ago

It sounds like you want webhooks for Libki logins. Can you tell me what kind of data that webhook would need to transmit?

jfmartinezm commented 10 months ago

In this particular case, our system needs to get the username, the password and the ip address of the client. But maybe the webhook could allow to choose what information should be sent, with some kind of configuration setting, eg:

---
- webhook: http://server/endpoint
  attributes_to_send:
    - username
    - password
    - client.ipaddress

This way, the webhook system could be used to send different information to different endpoints, and perhaps on different events (login, logout, client registration, etc).

kylemhall commented 10 months ago

I like the idea, but not so much for sending a user's password anywhere.

jfmartinezm commented 10 months ago

It's true that having a password involved makes it more of an authentication issue than a simple notification/webhook one. Perhaps it should be handled on a custom authentication module like the one proposed in #305 (which I intended to build eventually anyway).

sekjal commented 6 months ago

Love the idea of webhooks on key events; that'll make Libki that much more interoperable with other systems.

I agree with Kyle that sending passwords is not appropriate for this feature, but would be for a custom authenticator. We'll use this issue for tracking webhooks, and #305 for the authenticator idea. Sound good?