Example #1
0
        /// <summary>
        /// Get Token for App.
        /// </summary>
        /// <returns>Token for app.</returns>
        public static async Task <string> GetTokenForAppAsync()
        {
            AuthenticationResult authResult;

            authResult = await IdentityAppOnlyApp.AcquireTokenForClientAsync(new string[] { "https://graph.microsoft.com/.default" });

            return(authResult.AccessToken);
        }