-
Notifications
You must be signed in to change notification settings - Fork 88
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
Bootstrapping oauth2 token #338
Comments
…nt obtained refresh token, see #338 git-svn-id: https://svn.code.sf.net/p/davmail/code/trunk@3522 3d1905a2-6b24-0410-a738-b14d5a86fcbd
Not a full answer to you request, but I added a -token command line option to just open the O365InteractiveAuthenticator and print refresh token on console |
If you combine davmail -token with the optional setting: davmail.oauth.tokenFilePath to set a separate file path for tokens you should be able to get seamless update of refresh tokens. Note that for windows users I also published a powershell script as an alternative to davmail -token at: |
Thanks for adding this feature! I tried this with the new 6.2.2 build. This also only works with the interactive authentication, which is slow when davmail is deployed on a headless server. Is it possible to make this work with O365Manual authentication, where the actual login can be conducted on a different machine? |
That doesn't make any sense. How can Can you provide step-by-step instructions to reproduce this, @kpedro88 ? Do you have |
I just tried again and it didn't stop the background process this time. The first time, I saw this after finishing step 3:
Unfortunately the log file got overwritten. I'll keep checking to see if it happens again. |
I am running davmail in headless (server) mode and using the O365Manual authentication mode. However, this requires some clunky switching back and forth between background and foreground when a new token needs to be obtained. The procedure seems to be:
Other oauth2 implementations that I've used provide a standalone script to obtain tokens (examples: https://github.com/tarickb/sasl-xoauth2/blob/master/scripts/sasl-xoauth2-tool.in, https://github.com/rlonstein/getmail/blob/master/getmail-gmail-xoauth-tokens, https://github.com/harishkrupo/oauth2ms). This would avoid the need for starting/stopping the server, or any foreground instances at all, or involving the mail agent. Whenever the server reports that it can no longer refresh the current token, we can just run the standalone script and get a new token.
In this case, the davmail.properties file could take arguments pointing to the location of each user's token file, rather than directly inserting the encoded refresh tokens.
I recognize that this is a non-trivial feature request, but it would make headless mode much smoother.
The text was updated successfully, but these errors were encountered: