Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding gmail oauth no longer working. #1076

Closed
PaulTGG opened this issue Jun 9, 2024 · 9 comments
Closed

Adding gmail oauth no longer working. #1076

PaulTGG opened this issue Jun 9, 2024 · 9 comments
Assignees

Comments

@PaulTGG
Copy link
Contributor

PaulTGG commented Jun 9, 2024

🐛 Bugreport

Trying to add gmail servers using oauth is broken again. After clicking "continue" as the last step in authorizing the connection, I'm dropped back to the Cypht login page. Cypht is correctly trying to send me back to the servers page, but I'm being sent back to the login page instead. Logging in at that point doesn't add the servers.

Version & Environment

Rev: e0670e4

Steps to reproduce

  1. Try to add a gmail account with the oauth2 connection, and the request uri being "https://server/cypht/?page=servers"
  2. Be sent back to the login page without adding the servers.
@indridieinarsson
Copy link
Contributor

I have been experiencing the exact same issue. I have cypht (master branch as of a week ago) running as a docker image behind a traefik reverse proxy. One account (standard imap) is set up.

When trying to set up a gmail account (having added the client id and secret from google to the cypht config), I get forwarded to the google page (with touch landing on a google page complaining of a non-verified app), confirm everything and am then redirected to the login page of my cypht as @PaulTGG describes.

I note that the address bar is showing a huge address starting with
https://example.com/?page=home&state=nux_authorization&code=[lots of random letters]&scope=https://mail.google.com/%20https://www.googleapis.com/auth/contacts
If I log in from this page, the gmail account has not been added once I log in.

On the other hand, If I repeat the process, but instead of entering my credentials on the login page, now I simply go to the address bar and press enter (re-navigating to the very long address described above), the login session from before seems to be still active, and I'm not required to log in. This time, I'm redirected to the servers page, and now the gmail account has been added to my list of servers, and I can happily read my emails.

Hope this helps.

@josaphatim
Copy link
Member

@PaulTGG On my end I'm able to add gmail account. Have you setup these 3 parameters correctly ?

GMAIL_CLIENT_ID=
GMAIL_CLIENT_SECRET=
GMAIL_CLIENT_URI=http://localhost/cypht-jos/?page=home

GMAIL_CLIENT_URI should point to your server + ?page=home

@PaulTGG
Copy link
Contributor Author

PaulTGG commented Jun 15, 2024

I had page=servers before (I've had it work in the past), and I just tried page=home, but had the same result - I get sent back to the login page, as if Cypht didn't remember that I was signed in. I'm currently on 63b9932, and I'm using a database for my settings, if that makes a difference.

@josaphatim
Copy link
Member

josaphatim commented Jun 15, 2024

Try to logout cypht and login then retry the operation.

@PaulTGG
Copy link
Contributor Author

PaulTGG commented Jun 15, 2024

@josaphatim It looks like it may have had something to do with the SSL set up on my local server. It wasn't forwarding to https appropriately, so I was able to get it work by ensuring I logged in with https to begin with. That said, I was still sent back to the login page, although I was able to make it work with the workaround that @indridieinarsson described above. It doesn't seem like it's working flawlessly.

@marclaporte
Copy link
Member

marclaporte commented Jun 19, 2024

@christer77 Please test with v 2.1.0 at https://hub.docker.com/r/cypht/cypht/

@christer77
Copy link
Member

@christer77 Please test with v 2.1.0 at https://hub.docker.com/r/cypht/cypht/

Noted, I'll get back to you with feedback

@marclaporte
Copy link
Member

@PaulTGG @indridieinarsson @christer77
Can you please test with latest stable release? https://github.com/cypht-org/cypht/releases/tag/v2.2.0

@indridieinarsson
Copy link
Contributor

@marclaporte : I'm setting up fresh 2.2 installation. Adding gmail now works as expected, and I am redirected to the appropriate page after having confirmed stuff at the gmail page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants