Hello,
I'm facing a difficult with TAdvOutlookMail while authenticating.
First time ever logging in, the component works pretty well: it opens the Browser on the MS Auth screen, the user login in, the application gets the Token, the Refresh and all that is needed.
If the user logout (or on our Dev environment, if we delete all auth info, clean all browser cache, etc), and try to login in again, it doesn't open the MS Auth screen, it goes straight to the previous logged account, without asking for the Email and Password, so if we need to change our logged email, it is not possible.
How can I force the component to show the MS Email/Password screen every time that is connecting without a valid Token/Refresh?
Even with the Logout code being called, it is going straight to my previous logged email without asking me for User/Password to login in with another account.
I have not been able to reproduce this issue here.
Can you please try this workaround?
Create a new project
Place a TWebBrowser control on the form
Navigate to the logout url WebBrowser1.Navigate('https://login.live.com/oauth20_logout.srf');
Alternatively, please consider migrating to TMS FNC Cloud Pack where this issue can be avoided as authentication is handled in an external browser window.
More information can be found here:
The issue persists even with the recommended 'solution'.
Is it possible to use an external Auth and Refresh tokens with TAdvOutlookMail?
I mean, we have an external component that properly logins in Outlook with same Azure project and etc.
Is it possible to get its Auth and Refresh token and fill up the TAdvOutlookMail component?
Reading the source code, your component works with some fields that I'm not sure where to get they from. AUTH_TOKEN and REFRESH_TOKEN I can guess what they are, but the followed ones, I'm not sure..
ACCESS_TOKEN, ACCESS_TOKEN_SECRET, AUTH_TOKEN_SECRET, EXTRA_DATA
Unfortunately it's not supported to use tokens retrieved from an external source because the component only accepts encrypted tokens by using the SaveTokens/LoadTokens calls.
Sorry Bart, I'm not sure if I can do logout from all devices.
I'm not sure which account it is connected to. The 'AdvOutlookMail1.Profile.Email' returns empty string.
I also don't know which Browser this component uses (if MS Explorer, Edge, Chrome, or the OS default browser), so I could logout on the correct browser.
Since the component sues the methods to encrypt the tokens, how "TMS FNC Cloud Pack" could be a fit for my needs?
The TMS VCL Cloud Pack is using the TWebBrowser component to display internal browser windows.
TWebBrowser is based on the IE engine.
The TMS FNC Cloud Pack is using only external browser windows because many services are no longer supporting the use of internal browser windows.
Using an external browser window means that the system default browser is used to display login pages and you can navigate to the service in question to manually logout if necessary.
I cleaned all IE cache, saved password, history, etc...
No success, still login in straight way to my account.
About TMS FNC CloudPack, I got how it works to login in, but how is it integrated with TAdvOutlookMail since this doesn't accept external tokens? (Tokens coming from external source)
Have you tried using the logout form all devices link?
Please note that caching in the TWebBrowser is separate from the IE browser caching.
The TMS FNC Cloud Pack contains the TTMSFNCCloudMicrosoftOutlookMail component which provides the same functionality as the TAdvOutlookMail component in TMS VCL Cloud Pack.
The TMS FNC Cloud Pack can replace the TMS VCL Cloud Pack to access the Outlook API.
A fully functional trial version including demos is available here: