-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
SMTP Oauth authentication error (Azure) #18796
Comments
Hello, I think this FAQ article might help you configure your alias with SMTP + OAuth : |
From FAQ:
Account is the same, there is only one, BUT id (for auth) and email are not the same string. I am not trying to send email with an alias, it is the main email (it differs from user id). Wording may be improved, maybe in a separate issue. Anyways, the assumption that email and user id is the same, is plainly wrong. What we have now is little confusing (according to my asumptions and code review):
Asking both 'smtp_auth_id' and 'smtp_email' (field names are for ilustration purposes) like SMTP Basic integration alreadydoes, issue would be fixed 'easily'. A compatible fix with current implementation:
Today just checked Microsoft Entra ID docs/guidance, and it matches my recommendation: https://learn.microsoft.com/en-us/entra/identity-platform/id-token-claims-reference
Still, if the decision is a 'no fix' I would:
|
Code of Conduct
Is there an existing issue for this?
Version
10.0.15
Bug description
TL;DR: smtp username might not be the same as email, and SMTP XOAUTH2 flow will fail. GLPI would autodisolver this using UPN, or populated by user in frontend, like it is done with SMTP Auth (BASIC)
https://forum.glpi-project.org/viewtopic.php?id=291362
GLPI 10.0.15, On-prem AD, and Entra ID Synchronized
Our support account’s username and primary SMTP address are not the same. I logged in successfully via browser, but then test SMTP fails.
I tested the equivalent configuration (SMTP+OAUTH) with my individual company user account, which has identical UPN and email, and it worked successfully. This corner case is handled correctly by GLPI SMTP AUTH (Basic), where you can specify login and email information separately. However, it seems that SMTP OAUTH might be using the email as the username (i.e. UPN), which would be incorrect.
If this is reproduced, it will be an issue for a lot of users when migrating to SMTP OAUTH this fall. If this is a no-fix, docs will have to be updated to require UPN and email to hold the same value.
For example: https://github.com/glpi-project/glpi/blob/main/front/smtp_oauth2_callback.php
From the code above, the
refresh_token
will be correct, butsmtp_username
may not, as in our case. Here’s an example of a message exchange between a client and an SMTP server using OAuth 2.0 for authentication. In this scenario, the UPN is [email protected], the email address is [email protected], and the OAuth access token is AAAA:The base64-encoded string is:
Here
user
needs to be the id (UPN in Azure) and not email. Another openid field that may work ispreferrred_username
, still don't know if it contains org '@contoso.com'.Relevant log output
Page URL
No response
Steps To reproduce
You may try to set up SMTP+OAUTH mail with an Azure account like:
user (UPN): [email protected]
primary email: [email protected]
(we still had [email protected], UPN, as secondary email/alias)
Your GLPI setup information
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: