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

Outlook oauth - cannot wait for redirection error #570

Open
Krowemoh opened this issue Mar 18, 2025 · 1 comment
Open

Outlook oauth - cannot wait for redirection error #570

Krowemoh opened this issue Mar 18, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@Krowemoh
Copy link

I could be doing something wrong (hopefully). I'm getting a page that displays a successful auth:

Authentication successful!

But then in himalaya, I get the following error

Error:
   0: cannot wait for oauth2 redirection error
   1: cannot exchange code for access and refresh tokens: error while sending request

I have a configuration already set up with my keyring set up. To try and get the auth done, I'm running:

himalaya account doctor --fix --trace

The configuration:

[accounts.outlook]
default = true
email = "[email protected]"
display-name = "username"
downloads-dir = "/home/usr/username/Downloads"

backend.type = "imap"
backend.encryption.type = "tls"
backend.host = "outlook.office365.com"
backend.port = 993
backend.login = "[email protected]"
backend.auth.type = "oauth2"
backend.auth.method = "xoauth2"
backend.auth.client-id = "CLIENT-ID"
backend.auth.client-secret.keyring = "outlook-oauth2-client-secret"
backend.auth.access-token.keyring = "outlook-oauth2-access-token"
backend.auth.refresh-token.keyring = "outlook-oauth2-refresh-token"
backend.auth.auth-url = "https://login.microsoftonline.com/TENANT-ID/oauth2/authorize"
backend.auth.token-url = "https://login.microsoftonline.com/TENANT-ID/oauth2/token"
backend.auth.pkce = true
backend.auth.scopes = ["https://graph.microsoft.com/IMAP.AccessAsUser.All","https://graph.microsoft.com/SMTP.Send"]
backend.auth.redirect-scheme = "http"
backend.auth.redirect-host = "localhost"
backend.auth.redirect-port = 8203

message.send.backend.type = "smtp"
message.send.backend.host = "smtp.mail.outlook.com"
message.send.backend.port = 587
message.send.backend.starttls = true
message.send.backend.login = "[email protected]"
message.send.backend.auth.type = "oauth2"
message.send.backend.auth.method = "xoauth2"
message.send.backend.auth.client-id = "CLIENT-ID"
message.send.backend.auth.client-secret.keyring = "outlook-oauth2-client-secret"
message.send.backend.auth.access-token.keyring = "outlook-oauth2-access-token"
message.send.backend.auth.refresh-token.keyring = "outlook-oauth2-refresh-token"
message.send.backend.auth.auth-url = "https://login.microsoftonline.com/TENANT-ID/oauth2/authorize"
message.send.backend.auth.token-url = "https://login.microsoftonline.com/TENANT-ID/oauth2/token"
message.send.backend.auth.pkce = true
message.send.backend.auth.scopes = ["https://graph.microsoft.com/IMAP.AccessAsUser.All","https://graph.microsoft.com/SMTP.Send"]

As an aside, has the himalaya configure -a outlook been deprecated? I stumbled into the doctor command which seems to be doing what I want but not sure.

@soywod
Copy link
Member

soywod commented Mar 24, 2025

I plan to refactor the OAuth lib, so I will investigate as soon as I dive into the topic. Thank you!

@soywod soywod added the bug Something isn't working label Mar 24, 2025
@soywod soywod moved this to Todo in Pimalaya Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants