mirror of
https://github.com/cypht-org/cypht.git
synced 2026-04-25 04:56:03 +03:00
[GH-ISSUE #1463] 🐛 [Bug] Outlook oauth account invalid redirect url query #663
Labels
No labels
2fa
I18N
PGP
Security
Security
account
advanced_search
advanced_search
announcement
api_login
authentication
awaiting feedback
blocker
bug
bug
bug
calendar
config
contacts
core
core
devops
docker
docs
duplicate
dynamic_login
enhancement
epic
feature
feeds
framework
github
github
gmail_contacts
good first issue
help wanted
history
history
imap
imap_folders
inline_message
installation
keyboard_shortcuts
keyboard_shortcuts
ldap_contacts
mobile
need-ssh-access
new module set
nux
pop3
profiles
pull-request
question
refactor
release
research
saved_searches
smtp
strategic
tags
tests
themes
website
wordpress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/cypht#663
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @WEGIII on GitHub (Mar 5, 2025).
Original GitHub issue: https://github.com/cypht-org/cypht/issues/1463
Originally assigned to: @christer77, @Baraka24 on GitHub.
🐛 Bug
The redirect variable "http://localhost/?page=home" is not accepted in certain Azure app configs.
The Azure app redirect URL is not allowed to have a query in it unless the app is only for work or school accounts. See here: https://learn.microsoft.com/en-us/entra/identity-platform/reply-url.
I was able to complete the oauth GMAIL app setup as they took the queried redirect URL. I did modify the redirect URL to match my domain.
If I am misunderstanding this or there is a known fix, please advise. Thanks!
Version & Environment
Rev: cypht/cypht:2.4.0
OS: Docker Install
@christer77 commented on GitHub (Mar 13, 2025):
Hello @WEGIII ,
Thank you for this issue.
which messaging service are you trying with?
Gmail or Outlook or Office365 or..?
@christer77 commented on GitHub (Mar 13, 2025):
If is outlook oauth
set your client_id, client_secret and redirect_url(client_uri)
#aoutlook
OUTLOOK_CLIENT_ID=your client_id
OUTLOOK_CLIENT_SECRET=your client_secret
OUTLOOK_CLIENT_URI=http://localhost:8800/
OUTLOOK_AUTH_URI=https://login.live.com/oauth20_authorize.srf
OUTLOOK_TOKEN_URI=https://login.live.com/oauth20_token.srf
OUTLOOK_REFRESH_URI=https://login.live.com/oauth20_token.srf
@WEGIII commented on GitHub (Mar 13, 2025):
Outlook.com
It seems using the port made some type of progress, but is still not working. MS Azure accepted the port as part of the redirect URI.
When trying to add the email account via outlook using OUTLOOK_CLIENT_URI=http://localhost:8800/ connection is refused.
When trying to add the email account via outlook using OUTLOOK_CLIENT_URI=https://DOMAIN:8800/ connection times out.
Unfortunately, no errors in the container log, any ideas?
@christer77 commented on GitHub (Mar 13, 2025):
Use of the port? No, that's my way of accessing the CYPTH application in localhost. If your URL doesn't require the port to access it, you won't need to populate the port.
@WEGIII commented on GitHub (Mar 13, 2025):
I am able to access the application via domain or localhost. The concern is while trying to add the oauth redirect URI to the Azure app. In the screenshot below, Azure, this is where the redirect variable "http://localhost/?page=home" is not accepted due to it being a query string.
@christer77 commented on GitHub (Jun 24, 2025):
Hello @WEGIII
Can you test this
@Huiaei commented on GitHub (Aug 19, 2025):
1. App Password Login Issue
2. OAuth 2.0 Authentication Issues
Refer to the Cypht documentation (OAuth) and environment variable configuration methods for setup.
2.1. Initial Attempt and Error
redirect_uriparameter in the link used washttps://localhost/?page=home.invalid_request: The provided value for the input parameter 'redirect_uri' is not valid. The expected value is a URI which matches a redirect URI registered for this client application.(The redirect URI does not match what is registered for this client application.)2.2. Azure AD Redirect URI Configuration Restriction
?page=home).2.3. Successful Redirection in Local Environment
redirect_uritohttps://localhost, the OAuth authorization process successfully redirected back.https://localhost/?code=xxxxxxxxxxxxx&state=nux_authorization, indicating that the authorization code was received.2.4. Error After Switching to Production Domain
localhostwith the actual domainaaa.comin the successful link, i.e.,https://aaa.com/?code=xxxxxxxxxxxxx&state=nux_authorization, resulted in an "An Error Occurred" message on the page.redirect_uritohttps://aaa.com/?page=home(despite Azure AD not supporting query strings) also displayed "An Error Occurred".Additional Note: Outlook SMTP Server Configuration
smtp.office365.com.smtp-mail.outlook.com.Thanks to Gemini for the translation and text reformatting, making it easier to understand.
@Huiaei commented on GitHub (Aug 19, 2025):
After reconfiguring from scratch, everything is now working correctly.
The deployment still follows the documentation to obtain the
client_idandclient_secret. The key steps involve modifying theredirect_url(i.e.,client_uri) and the corresponding environment variables, and then adding the Outlook accounts.Environment variable configuration is crucial:
Please note that
OUTLOOK_CLIENT_URIandredirect_urlmust be set to the domain you use to access the Cypht service. For example, if you access your service viahttps://aaa.com, then both should be set tohttps://aaa.com.Furthermore, different Outlook accounts can share the same
client_idandclient_secret, meaning there's no need to repeatedly configure and generate them for each account.@Huiaei commented on GitHub (Aug 19, 2025):
The Outlook SMTP authentication issue persists. Test results show either "Failed to authenticate to the SMTP server" or "Connected, but failed to authenticate to the SMTP server." Additionally, attempts to edit the relevant settings result in a save failure with the error "Authentication failed."
@christer77 commented on GitHub (Aug 20, 2025):
Thank you @Huiaei for your feedback.
I am trying to reproduce your issue by reinstalling my entire environment.
I will get back to you shortly.
@marclaporte commented on GitHub (Jan 28, 2026):
Related: https://github.com/cypht-org/cypht/issues/1846