smhaller / ldap-overleaf-sl

Free LDAP and OAuth2 Authentication and Authorisation for Sharelatex / Overleaf (Community Edition)
GNU Affero General Public License v3.0
74 stars 35 forks source link

Added check for active OAuth to login route #43

Open xathon opened 10 months ago

xathon commented 10 months ago

This adds a way to directly skip the login page when OAuth is enabled.

If needed, there could be a variable to enable this, although I don't see the value since adding the OAuth provider broke the regular login for me anyway.

Fixes #42 .

yzx9 commented 10 months ago

Should we reuse the ALLOW_EMAIL_LOGIN option? Although it differs somewhat from the current semantics.

Update: Furthermore, we can introduce an option to disable LDAP login, given that OAuth2 authentication operates independently. Consequently, this PR does not require the inclusion of a new option.

yzx9 commented 8 months ago

I prefer to introduce a new option LDAP_ENABLED, ensuring redirection occurs only when both email and LDAP logins are disabled. This option should also be added to the LDAP entry.

Additionally, disabling the login page may result in an infinite redirection loop. If OAuth login fails, we redirect to the /login page, which then redirects back to /oauth/redirect, creating a continuous cycle.