RainLoop / rainloop-webmail

Simple, modern & fast web-based email client
http://rainloop.net
MIT License
4.11k stars 892 forks source link

How to enable OAuth2 on rainloop? #1592

Open Drabiv opened 6 years ago

Drabiv commented 6 years ago

Hi, I would like to enable OAuth2 authorization and setup it to work with my domain. I am not able to understand how to do this. I found this library (https://github.com/RainLoop/rainloop-webmail/tree/master/rainloop/v/0.0.0/app/libraries/PHP-OAuth2), but there is no explanation on how to use/enable it. Should it be packaged as a plugin? Or should it be somehow enabled in config?

Can someone explain the solution or provide some starting point. I would write a plugin if neccessary, but just do not understand where to start.

ervee commented 6 years ago

This? http://www.rainloop.net/docs/social/

Drabiv commented 6 years ago

Hi @ervee. Thanks for the link, but it describes how to enable OAuth2 for standard social networks (Facebook, Twitter, Google). What I am trying to accomplish is to enable OAuth2 for my own application - meaning I want users to be able to login to Rainloop using user accounts from my application. Is there a way to do this? I looked into social.php file where OAuth2 login is done for Facebook, Twitter, etc and I think I would be able to amend it and add OAuth2 login for my own application, but I guess that would break on the next Rainloop update. Is there a way to make custom OAuth2 application as plugin (or enable it in Rainloop core)? I suspect this library (https://github.com/RainLoop/rainloop-webmail/tree/master/rainloop/v/0.0.0/app/libraries/PHP-OAuth2) is about this, but I do not understand how to use/enable it. I see that it is not used for Facebook, Twitter, Google OAuth2. Is there any example on how to use this library? If needed I am willing to implement custom OAuth2 as plugin and share it with community, but I am just not sure where to start. Is there a FAQ, some tutorial on how to write plugins for Rainloop?

For example, here is OAuth2 plugin for mediawiki - https://www.mediawiki.org/wiki/Extension:OAuth2_Client. This is what I am looking for Rainloop.

Drabiv commented 6 years ago

Hi @adoy, as you are a co-author of PHP-OAuth2 library (https://github.com/adoy/PHP-OAuth2) maybe you will be able to clarify how to use it together with Rainloop?

ervee commented 6 years ago

Okay, I understand what you want. Unfortunately I'm no help to you, I lack the coding skills and RainLoop internals knowledge.

hostquota commented 6 years ago

Drabiv You might like to look at this: http://www.barnraiser.org/aroundme Scroll right down and select the very last identity server link.This is an open id identity server, although it is oauth2 the project was abandoned some years ago, but it's a brilliant script which I'm thinking of forking in the near future. You'll find it works but you need to understand the install procedure which is explained, only not too well, but I can help with that. Basically it's like a full social network where a user signs up and has there own open id. Urls could be subdomains such as user.domain.com or could be domain.com/user. The css is easily customised and I recently added a responsive 3 column css, and will include it in the fork. So when a user signs up, any site they log in to using oauth2, will automatically be added to their page. There are various plug ins included, but it would be wise to check the script for security issues. They also do the prairie Id server, again abandoned but took the place of aroundme. I've never had any success in installing it, although it has been forked and is probably available on github. To install, you would need to upload all files to your domain, get a database ready, set up wildcard sub domains which divert to your site/ your id server folder/aroundmei_xxxx. Then you would need to set up the root domain to direct to the same folder, but that can be changed back after the install. Then proceed to the url and follow directions on screen. Alternatively, Drupal do an Oauth2 id server module. You can also get more info on the janrain website. I have used aroundme i several times in the past, and it's a really interesting script to enable you to provide open id log-ins. The idea is that once a person has an open id, they can then use it to login to rainloop, and the module in rainloop does the rest.

plabanowski commented 6 years ago

Hi, very important topic in the use of rainloop. Did you manage to add this feature to rainloop ?? Add a personnal Oauth2 (openid connect) for authentication on rainloop. (Other than google faceboobk,with a same protocol).

joshp23 commented 4 years ago

This is a feature that I would really appreciate, and it certainly is possible, but unfortunately is also not likely to be implemented by the devs as per https://github.com/RainLoop/rainloop-webmail/issues/351#issuecomment-59039947

There's always the possibility to add a plugin to handle this. Perhaps my next weekend project.