Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Demos/02-add-aad-auth/graph-tutorial/Helpers/GraphHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ public static async Task<User> 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();
Expand Down
5 changes: 3 additions & 2 deletions Demos/03-add-msgraph/graph-tutorial/Helpers/GraphHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ public static async Task<User> 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();
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion tutorial/04-add-aad-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down