public MessageManager(string graphEndpoint, string teamId, string channelId) { this.httpClient = new HttpClient(); this.graphEndpoint = graphEndpoint; this.teamId = teamId; this.channelId = channelId; this.authProvider = (MyAuthenticationProvider) new UserAuthenticationProvider(); }
private static GraphServiceClient GetAuthenticatedClient(MyAuthenticationProvider provider) { GraphServiceClient client; client = new GraphServiceClient( microsoftGraphV1, new DelegateAuthenticationProvider( async(requestMessage) => { var token = await provider.GetAccessTokenAsync(); requestMessage.Headers.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("bearer", token); })); return(client); }