Is it possible to force a certain email account to be used when triggering login in the browser? Or at least suggest a predefined email account.
After logging in, how can I check the used email account ?
The reason for the questions is that I want to use only one email account for login in the browser.
This is shared between all clients and server applications.
The server applications are running 24/7 and are responsible for updating the access token before it expires. Btw, it would be a nice feature to have autorefresh access token built in CloudPack.
In theory, this should work to refresh the access token 24/7. But if something goes wrong and browser login is triggered for a user, any email account can be used for login. So want to make sure this doesn't happen.
Unfortunately we have no control over the external browser window. This is determined by the browser settings and the service provider (Microsoft).
After connecting, the authenticated user's email address can be retrieved with the GetUserInfo call.
Example:
procedure TForm1.TMSFNCCloudMicrosoftOutlookMail1Connected(Sender: TObject);
begin
TMSFNCCloudMicrosoftOutlookMail1.GetUserInfo;
end;
procedure TForm1.TMSFNCCloudMicrosoftOutlookMail1GetUserInfo(Sender: TObject;
const ARequestResult: TTMSFNCCloudBaseRequestResult);
begin
ShowMessage(TMSFNCCloudMicrosoftOutlookMail1.Profile.Email);
end;
Thank you for your suggestion about access token auto-refresh. We will investigate improving the access token refresh flow in a future version of TMS FNC Cloud Pack.