diff --git a/Demos/02-add-aad-auth/graph-tutorial/Helpers/GraphHelper.cs b/Demos/02-add-aad-auth/graph-tutorial/Helpers/GraphHelper.cs index 2e5d875..59a8268 100644 --- a/Demos/02-add-aad-auth/graph-tutorial/Helpers/GraphHelper.cs +++ b/Demos/02-add-aad-auth/graph-tutorial/Helpers/GraphHelper.cs @@ -13,10 +13,11 @@ public static async Task GetUserDetailsAsync(string accessToken) { var graphClient = new GraphServiceClient( new DelegateAuthenticationProvider( - async (requestMessage) => + (requestMessage) => { requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); + return Task.FromResult(0); })); return await graphClient.Me.Request().GetAsync(); diff --git a/Demos/03-add-msgraph/graph-tutorial/Helpers/GraphHelper.cs b/Demos/03-add-msgraph/graph-tutorial/Helpers/GraphHelper.cs index dd47598..cd82c1b 100644 --- a/Demos/03-add-msgraph/graph-tutorial/Helpers/GraphHelper.cs +++ b/Demos/03-add-msgraph/graph-tutorial/Helpers/GraphHelper.cs @@ -26,10 +26,11 @@ public static async Task GetUserDetailsAsync(string accessToken) { var graphClient = new GraphServiceClient( new DelegateAuthenticationProvider( - async (requestMessage) => + (requestMessage) => { requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); + return Task.FromResult(0); })); return await graphClient.Me.Request().GetAsync(); @@ -58,7 +59,7 @@ private static GraphServiceClient GetAuthenticatedClient() .WithClientSecret(appSecret) .Build(); - var tokenStore = new SessionTokenStore(idClient.UserTokenCache, + var tokenStore = new SessionTokenStore(idClient.UserTokenCache, HttpContext.Current, ClaimsPrincipal.Current); var accounts = await idClient.GetAccountsAsync(); diff --git a/tutorial/04-add-aad-auth.md b/tutorial/04-add-aad-auth.md index b9b94e8..3d7ad42 100644 --- a/tutorial/04-add-aad-auth.md +++ b/tutorial/04-add-aad-auth.md @@ -239,10 +239,11 @@ Once the user is logged in, you can get their information from Microsoft Graph. { var graphClient = new GraphServiceClient( new DelegateAuthenticationProvider( - async (requestMessage) => + (requestMessage) => { requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); + return Task.FromResult(0); })); return await graphClient.Me.Request().GetAsync();