Skip to content

How to authenticate Extended (Outlook) MAPI application with MSAL ? #5100

@nourelain44

Description

@nourelain44

I have an Extended MAPI application running as a Windows Service that connects to O365 mailboxes.
This application uses a pre-configured Outlook profile to log on to a mailbox.

The application runs fine until the tokens acquired by Outlook expire.
Since it runs as a service, there is no human that can run Outlook manually to refresh the tokens.

Now I have to modify this application to either acquire / refresh the Outlook tokens myself or to get / refresh tokens that enable my application to login to the mailbox using the Extended Outlook MAPI libraries.

How would I use MSAL to authenticate my application and refresh the token automatically before it expires?

I see samples on how to use MSAL to authenticate to make Graph calls, but I cannot understand how the acquired tokens would be used by my application / passed-on to the Outlook (Extended MAPI) libraries, as this is not Graph.

Since Outlook itself uses Extended MAPI as well, I wonder how it's done in Outlook?

I am completely new to MSAL and hope anyone can point me into the right direction or describe what needs to be done.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions