Best pratice to authenticate web api from outlook plug-in RRS feed

  • Question

  • Hello All,

    I'm new in VSTO programming, I have one outlook plug-in which call one C# REST Api to get user detail from SQL SERVER. so what is best practice to authenticate api call ?

    How we can store token at outlook client side ?


    Sanjay Patel

    Monday, June 20, 2016 1:47 PM


  • Hello Sanjel,

    You can treat your VSTO based add-in like a regular Windows Forms application. There is no difference between them in case of using REST API.

    The StorageItem class from the Outlook object model represents a message object in MAPI that is always saved as a hidden item in the parent folder and stores private data for Outlook solutions. StorageItem object is stored at the folder level, allowing it to roam with the account and be available online or offline.

    Once you have obtained a StorageItem object, you can do the following to store solution data:

    • Add attachments to the item for storage.
    • Use explicit built-in properties of the item such as Body to store custom data.
    • Add custom properties to the item using UserProperties.Add method. Note that in this case, the optional AddToFolderFields and DisplayFormat arguments of the UserProperties.Add method will be ignored.
    • Use the PropertyAccessor object to get or set custom properties.

    For more information on storing solution data using the StorageItem object, see Storing Data for Solutions.


    Monday, June 20, 2016 2:19 PM