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

Automated re-authentication #99

Closed
woodpk opened this issue Nov 23, 2022 · 4 comments
Closed

Automated re-authentication #99

woodpk opened this issue Nov 23, 2022 · 4 comments

Comments

@woodpk
Copy link

woodpk commented Nov 23, 2022

I believe this issue may have already been discussed (possibly issue #2 and in the README).
However, I'm not sure so i'm going to ask here.
Reading the documentation, it is clear that you have built the script to be able to start on user login and to use a non GUI mode for use in a server environment.
I am not clear on whether or not you have built the script to be able to automatically re-authenticate using the existing token after a restart (say a server crashes).
When i restart my computer to test, it correctly runs the script (in this case, it is running with the GUI), but when sending send/receive requests to the proxy, it forces an interactive reauthentication session.
It works great as long as the computer doesn't have to restart, but once I restart, it requires manually putting in my account password again.
Is this the expected behavior of the script or am I missing something?
Thanks for your help!

@simonrob
Copy link
Owner

The proxy saves the OAuth 2.0 token after a successful authentication attempt, and you shouldn't be prompted again for this until the email provider requires re-authentication. There shouldn't be any link whatsoever to a computer restart, and this behaviour is the same regardless of whether you use the GUI or not.

You mention testing – are you using the same IMAP/POP/SMTP password each time? The proxy's default behaviour is to re-authenticate when it is unable to decrypt the saved credentials due to an incorrect IMAP/POP/SMTP password. It may be worth setting delete_account_token_on_password_error = False at the end of the configuration file to check whether this is the cause.

@woodpk
Copy link
Author

woodpk commented Nov 24, 2022 via email

@simonrob
Copy link
Owner

Thanks for following up. To be clear: if changing this setting has resolved the issue, it means that somewhere in your setup you are trying to log in to the account with an incorrect password, so it might be worth looking into this.

@woodpk
Copy link
Author

woodpk commented Nov 25, 2022

It's possible. I wasn't paying 10% attention to the password (it was saved on thunderbird email client).
I cleared the client cache, set the property you mentioned to false, and tested all day with multiple restarts. It seems to be working very consistently now.

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

2 participants