[GH-ISSUE #1076] Adding gmail oauth no longer working. #565

Closed
opened 2026-02-25 21:35:23 +03:00 by kerem · 9 comments
Owner

Originally created by @PaulTGG on GitHub (Jun 9, 2024).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/1076

Originally assigned to: @christer77 on GitHub.

🐛 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.
Originally created by @PaulTGG on GitHub (Jun 9, 2024). Original GitHub issue: https://github.com/cypht-org/cypht/issues/1076 Originally assigned to: @christer77 on GitHub. ## 🐛 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 <!-- Paste Git-Commit ID or Tag-Name here --> 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.
kerem closed this issue 2026-02-25 21:35:23 +03:00
Author
Owner

@indridieinarsson commented on GitHub (Jun 12, 2024):

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.

<!-- gh-comment-id:2162663658 --> @indridieinarsson commented on GitHub (Jun 12, 2024): 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.
Author
Owner

@josaphatim commented on GitHub (Jun 14, 2024):

@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

<!-- gh-comment-id:2167311961 --> @josaphatim commented on GitHub (Jun 14, 2024): @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
Author
Owner

@PaulTGG commented on GitHub (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.

<!-- gh-comment-id:2169156155 --> @PaulTGG commented on GitHub (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.
Author
Owner

@josaphatim commented on GitHub (Jun 15, 2024):

Try to logout cypht and login then retry the operation.

<!-- gh-comment-id:2169157142 --> @josaphatim commented on GitHub (Jun 15, 2024): Try to logout cypht and login then retry the operation.
Author
Owner

@PaulTGG commented on GitHub (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.

<!-- gh-comment-id:2169165080 --> @PaulTGG commented on GitHub (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.
Author
Owner

@marclaporte commented on GitHub (Jun 19, 2024):

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

<!-- gh-comment-id:2179068625 --> @marclaporte commented on GitHub (Jun 19, 2024): @christer77 Please test with v 2.1.0 at https://hub.docker.com/r/cypht/cypht/
Author
Owner

@christer77 commented on GitHub (Jun 20, 2024):

@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

<!-- gh-comment-id:2180221389 --> @christer77 commented on GitHub (Jun 20, 2024): > @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
Author
Owner

@marclaporte commented on GitHub (Aug 20, 2024):

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

<!-- gh-comment-id:2297738214 --> @marclaporte commented on GitHub (Aug 20, 2024): @PaulTGG @indridieinarsson @christer77 Can you please test with latest stable release? https://github.com/cypht-org/cypht/releases/tag/v2.2.0
Author
Owner

@indridieinarsson commented on GitHub (Aug 20, 2024):

@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.

<!-- gh-comment-id:2298410327 --> @indridieinarsson commented on GitHub (Aug 20, 2024): @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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#565
No description provided.