internal static async Task <Office365ServiceInfo> CreateAsync() { // For Exchange, the resource ID and API Endpoint are static for the public O365 cloud. Office365ServiceInfo info = new ExchangeServiceInfo() { ResourceId = "https://outlook.office365.com/", ApiEndpoint = "https://outlook.office365.com/ews/odata" }; info.AccessToken = await Office365Helper.GetAccessToken(info.ResourceId); return(info); }
/// <summary> /// Returns information about the Exchange service, including its access token. /// On error, this method will display an error message to the user, and return an /// Office365ServiceInfo instance whose HasValidAccessToken property is set to "false". /// </summary> public static async Task <Office365ServiceInfo> GetExchangeServiceInfoAsync() { return(await ExchangeServiceInfo.CreateAsync()); }