oliver1967
Forum Replies Created
-
@edwardcross
Thanks a bunch for looking into this. Actually, as the error was effecting the registration of new users, I could not wait for this issue to be analyzed. Also, while you are right that User Registration is a paid-for plugin, I did not receive the support I was expecting to see (as mentioned: all other plugins send emails without any issue, it was only User Registration causing the problems). So, I solved the issue by kicking out that plugin and replacing it with Ultimate Member, which works flawlessly. But having this issue also addressed in the new revision of your plugin, can’t hurt ??Thanks again – and all the best for the New Year,
OliverHi Ed,
just to double-check, I just did another test (after the website idling over night): refreshing the token works, everything is running well.
So, yes, you can consider this closed ??And for sure no reason to “sorry it took a while”. Actually, your support for this for-free plugin is dimensions above what others provide as so-called premium support for paid plugins. Kudos!!
Take care and keep up the great work,
OliverGuys,
good news from my side:
When I installed the new version earlier today, I did hit the Authorization button right after installation. And it’s so far working flawlessly. I intentionally had it sit for some hours (development site, so no traffic at all), just tested again after several hours of idle time – and it works like a charm.I’d agree that the issue was likely linked to differences in the Azure accounts (somehow). Might be, that there’s some kind of by-country difference.
Anyhow, it’s working now ??Thanks again Ed, awesome work!
Oliver
Hi Ed,
thanks again for the quick response.
I’ve installed V1.3 right now and will do some testing later today. I’ll report back later.Thanks again,
OliverHi Ed,
well, that’s what you get when trying to troubleshoot some code you don’t really fully understand ??
Guess I missed the part that a new token includes basically both, the access and the refresh token. Sorry for that.And, just BTW: I’m running PHP 7.4.14, ie the newest version.
Last but not least, I did some further debugging (by inserting some echo statements). Among others, I inserted echo statements in the “if ($access_token->hasExpired())” part, one right before the statement to refresh the token, and one right after that statement. Interestingly, I see the output of the first echo, but NOT the one of the second echo. Looks almost like the php script stops right when trying to get the new token.
Perhaps this is of help to you?Thanks,
OliverHi Ed,
while I do have quite a bit of coding background. I actually don’t know much about php and (as mentioned) I’m also not into the details of OAuth. Still, I couldn’t resist to have a look at your mail.php file. And I think, I may have some additional idea now:
According to the MS documentation for OAuth, when (successfully) refreshing an access token, the response not only includes a new access token, but also a refresh token. The MS website states:
“Although refresh tokens aren’t revoked when used to acquire new access tokens, you are expected to discard the old refresh token. The OAuth 2.0 spec says: “The authorization server MAY issue a new refresh token, in which case the client MUST discard the old refresh token and replace it with the new refresh token. The authorization server MAY revoke the old refresh token after issuing a new refresh token to the client.”Looking at your code, I think based on the getAccessToken response during the refresh, you update the access token with the newly received one. But I didn’t see any code where you also update the refresh token with the potentially revised one.
Again, I’m far from claiming that I’m even close to understanding your code, so this may be “utter bs” – if so, please kindly ignore ?? But I thought this may be a potential explanation of the odd behavior, as the MS documentation keeps it rather vague regarding if/when refresh tokens expire…
Let me know your thoughts.
Thanks,
OliverHi Edward,
thanks again.
As it’s working fine after the initial authentication and then stops after a while, I assume there’s some kind of timeout ongoing in the OAuth approach, but I’m not into the details. Based on what I read in the MS documentation (https://docs.microsoft.com/en-us/microsoft-365/enterprise/session-timeouts?view=o365-worldwide) it looks like the initial authorization times out after 1 hour and then needs to be renewed using the refresh token. But I assume that’s how your plug-in works (and again, I’m not into any of the details behind).Regarding the other mail plugins, I originally had WP Mail SMTP installed and activated (prior to installing your plugin). I still have it installed, but it’s deactivated. If helpful, I can play around with that as well, just let me know.
Thanks,
OliverHi Ed,
thanks a bunch for the quick response.
So, I’m currently in the situation again where my website stopped sending emails.
I installed the two plug-ins as suggested. Interestingly, WP Test Email says that it sent the test email successfully, and WP Mail Logging shows the test email. I do NOT get any error messages at all, while the email actually isn’t sent.Any ideas?
Thanks again,
OliverHi Edward,
first of all kudos to you for your terrific work!
I have installed this plugin a few days ago – and while I’m still in testing phase, I have to second Jaxson’s comment/request.
I’m facing the exact same issue: the plugin is working fine, and when I return the next day and do some test run it’s no longer sending any email. Once I hit the “Authorise plugin to integrate with Office 365” button again, it’s working. I have not yet done more testing on how long it takes until it stops working, but it’s more than the one hour you mentioned and less than 24 hours. Also, I have not changed any domains recently (like Jaxson), so there must be something else ongoing…
Please let me know if I can do any specific tests…
Thanks,
Oliver