TAdvOutlookMail - login in automatically with the last account logged

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?

Hi,

Can you please try using the Logout call before authenticating to make sure the previously logged in account has been logged out?

AdvOutlookMail1.Logout;

Hello Bart,
thank you for your reply.

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.

Video 2023 01 16 14 55 26 - YouTube

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:

Hello Bart,
ty for your reply.

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

Hi,

  • I'm not sure why the Logout call is not working for you.
    Can you try to logout from all instances from this link?
    https://account.live.com/proofs/manage/additional

  • 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:

1 Like

Hi Bart,
thank you for your reply and time.

We tried the FNC Cloud Pack and it seems to work as expected: after logout "Clear button", if new Connection needed, it asks for account selection.

We will try our use cases with the Test installation and see how to proceed from here.

Feel free to check this as Solved if I don't find it soon...

Thank you.

Happy to help!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.