private async Task <AuthenticationResult> GetAuthenticationResultAsync() { AuthenticationResult authenticationResult; try { // Try to get the tokens silently. authenticationResult = await _authenticationService.AcquireTokenSilentAsync(); return(authenticationResult); } catch { // Ignored. } // Prompt the user. authenticationResult = await _authenticationService.AcquireTokenAsync(); return(authenticationResult); }
private Task <AuthenticationResult> AcquireTokenForApplicationAsync() { return(_authenticationService.AcquireTokenAsync(GraphResource, _clientCredential)); }