mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 04:56:03 +03:00
[GH-ISSUE #786] Authenticate users via OpenID Connect (oidc) #480
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#480
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CyberFoxar on GitHub (Oct 8, 2023).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/786
🚀 Feature
OpenID Connect is a well known protocol to authenticate users across multiple applications. It is the basis for a lot of self-hosted / self-deployed solutions. The typical deployment has the administrator deploy an authentication server (typically using keycloak server) that is responsible for keeping track of users.
Keycloak handles the authentication part of the process, presenting users with a login form when thy try to access an app, authenticating them, then redirecting them to the app they wanted to access. If you've been in any moderately big company, you've certainly met some variance of this.
Design, Layout, Architecture
I suggest to create a "module" that would propose au new "auth_type",
oidc_auth. Ideally, it would not disable the normal auth flow, but it might be technically impractical to do so.Here's a proposed "flow":

When the module is active, a user is presented with the choice to authenticate with oidc. They might also be directly redirected, especially if it is the only way to authenticate.
When clicking the button, they are redirected to the oidc provider's portal (in this case, a very garish, custom keycloak landing page, we are very proud of it, it also makes noise when you type :3)
The users continue with the authentication flow on their side, and finally...
They get added to a db, or at least the webmail !
Depending on the implementation, of course. But ideally we should have ability to set some users as admin, maybe trough roles in keycloak, and the ability to save per-user preferences within cypht.
Additional notes
Upon asking on the gitter @marclaporte told me it has been done before-ish. It seems the tiki CMS rolled out its own way of doing it with cypht, and it might be used as a starting point.
There is also the option of using the lesser-implemented SAML authentication, but this issue focuses on OIDC.
@CyberFoxar commented on GitHub (Oct 8, 2023):
Of note, I will probably look into implementing it myself, but I'm strapped for time, and unfamiliar with PHP. So feel free to give it you own shot too !
If you need any details and such, I'll be around too ! Mostly on github, but I'll try to monitor the gitter too.
Especially if anyone needs help configuring and setting up keycloak. Since I've rolled my own, I might be able to give pointers or provide helping scripts.
@marclaporte commented on GitHub (Oct 8, 2023):
For Tiki, we use https://packagist.org/packages/steverhoades/oauth2-openid-connect-client so I recommend this as a starting point.
@marclaporte commented on GitHub (Nov 4, 2023):
Another idea to explore:
Tiki also added support for https://doc.tiki.org/Hybridauth-social-login
And it supports many providers: https://hybridauth.github.io/providers.html
Including "Keycloak OpenId Connect provider adapter."
Source: https://github.com/hybridauth/hybridauth/blob/master/src/Provider/Keycloak.php
@marclaporte commented on GitHub (Nov 5, 2023):
See also: https://github.com/hybridauth/hybridauth/issues/1005