Skip to content

Commit c98cd28

Browse files
committed
2 parents fbbeb3b + be732c6 commit c98cd28

File tree

17 files changed

+743
-95
lines changed

17 files changed

+743
-95
lines changed

packages/providers/mgt-msal2-provider/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"dependencies": {
4242
"@microsoft/mgt-element": "*",
4343
"@microsoft/microsoft-graph-client": "^2.2.1",
44-
"@azure/msal-browser": "^2.14.2"
44+
"@azure/msal-browser": "^2.16.1"
4545
},
4646
"publishConfig": {
4747
"directory": "dist"

packages/providers/mgt-teams-msal2-provider/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@microsoft/mgt-element": "*",
4646
"@microsoft/mgt-msal2-provider": "*",
4747
"@microsoft/microsoft-graph-client": "^2.2.1",
48-
"@azure/msal-browser": "^2.14.2"
48+
"@azure/msal-browser": "^2.16.1"
4949
},
5050
"publishConfig": {
5151
"directory": "dist"

samples/angular-app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"@angular/platform-browser": "~9.1.6",
2020
"@angular/platform-browser-dynamic": "~9.1.6",
2121
"@angular/router": "~9.1.6",
22-
"@azure/msal-angular": "^2.0.0",
23-
"@azure/msal-browser": "^2.14.2",
22+
"@azure/msal-angular": "^2.0.2",
23+
"@azure/msal-browser": "^2.16.1",
2424
"@microsoft/mgt": "*",
2525
"rxjs": "~6.5.4",
2626
"tslib": "^1.10.0",

samples/angular-app/src/environments/environment.msal.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const isIE = window.navigator.userAgent.indexOf('MSIE ') > -1 || window.navigato
77

88
export const MsalConfig: Configuration = {
99
auth: {
10-
clientId: 'a974dfa0-9f57-49b9-95db-90f04ce2111a',
10+
clientId: '2dfea037-938a-4ed8-9b35-c05708a1b241',
1111
authority: 'https://login.microsoftonline.com/common/',
1212
redirectUri: 'http://localhost:4200/',
1313
postLogoutRedirectUri: 'http://localhost:4200/',
@@ -23,7 +23,6 @@ const consentScopes = ['user.read', 'openid', 'profile'];
2323
const protectedResourceMap = new Map<string, Array<string>>();
2424
protectedResourceMap.set('https://graph.microsoft.com/v1.0/', consentScopes);
2525

26-
2726
export const MsalInterceptorConfig: MsalInterceptorConfiguration = {
2827
interactionType: !isIE ? InteractionType.Popup : InteractionType.Redirect,
2928
protectedResourceMap

samples/proxy-provider-asp-net-core/Controllers/ProxyController.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,38 +33,38 @@ public ProxyController(IWebHostEnvironment hostingEnvironment, IGraphServiceClie
3333
[Route("{*all}")]
3434
public async Task<IActionResult> GetAsync(string all)
3535
{
36-
return await ProcessRequestAsync("GET", all, null).ConfigureAwait(false);
36+
return await ProcessRequestAsync(Microsoft.Graph.HttpMethods.GET, all, null).ConfigureAwait(false);
3737
}
3838

3939
[HttpPost]
4040
[Route("{*all}")]
4141
public async Task<IActionResult> PostAsync(string all, [FromBody] object body)
4242
{
43-
return await ProcessRequestAsync("POST", all, body).ConfigureAwait(false);
43+
return await ProcessRequestAsync(Microsoft.Graph.HttpMethods.POST, all, body).ConfigureAwait(false);
4444
}
4545

4646
[HttpDelete]
4747
[Route("{*all}")]
4848
public async Task<IActionResult> DeleteAsync(string all)
4949
{
50-
return await ProcessRequestAsync("DELETE", all, null).ConfigureAwait(false);
50+
return await ProcessRequestAsync(Microsoft.Graph.HttpMethods.DELETE, all, null).ConfigureAwait(false);
5151
}
5252

5353
[HttpPut]
5454
[Route("{*all}")]
5555
public async Task<IActionResult> PutAsync(string all, [FromBody] object body)
5656
{
57-
return await ProcessRequestAsync("PUT", all, body).ConfigureAwait(false);
57+
return await ProcessRequestAsync(Microsoft.Graph.HttpMethods.PUT, all, body).ConfigureAwait(false);
5858
}
5959

6060
[HttpPatch]
6161
[Route("{*all}")]
6262
public async Task<IActionResult> PatchAsync(string all, [FromBody] object body)
6363
{
64-
return await ProcessRequestAsync("PATCH", all, body).ConfigureAwait(false);
64+
return await ProcessRequestAsync(Microsoft.Graph.HttpMethods.PATCH, all, body).ConfigureAwait(false);
6565
}
6666

67-
private async Task<IActionResult> ProcessRequestAsync(string method, string all, object content)
67+
private async Task<IActionResult> ProcessRequestAsync(Microsoft.Graph.HttpMethods method, string all, object content)
6868
{
6969
var graphClient = _graphServiceClientFactory.GetAuthenticatedGraphClient((ClaimsIdentity)User.Identity);
7070

samples/proxy-provider-asp-net-core/Views/Home/Index.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
1+
<!-- Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
22
See LICENSE in the source repository root for complete license information. -->
33

44
@{
@@ -14,5 +14,5 @@
1414
}
1515
@if (User.Identity.IsAuthenticated)
1616
{
17-
<mgt-person person-details="@ViewData["Response"]" person-image="@ViewData["Picture"]" show-presence view="twoLines" person-card="hover"></mgt-person>
18-
}
17+
<mgt-people></mgt-people>
18+
}

samples/proxy-provider-asp-net-core/mgt-netcore.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="3.1.5" />
12-
<PackageReference Include="Microsoft.Graph" Version="3.8.0" />
13-
<PackageReference Include="Microsoft.Identity.Client" Version="4.16.1" />
12+
<PackageReference Include="Microsoft.Graph" Version="4.3.0" />
13+
<PackageReference Include="Microsoft.Identity.Client" Version="4.35.1" />
1414
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
1515
</ItemGroup>
1616

samples/proxy-provider-asp-net-mvc/graph-tutorial/Controllers/GraphProxyController.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using graph_tutorial.Helpers;
1+
using graph_tutorial.Helpers;
22
using Microsoft.Graph;
33
using System;
44
using System.Collections;
@@ -22,38 +22,38 @@ public class GraphProxyController : ApiController
2222
[Route("{*all}")]
2323
public async Task<HttpResponseMessage> GetAsync(string all)
2424
{
25-
return await ProcessRequestAsync("GET", all, null).ConfigureAwait(false);
25+
return await ProcessRequestAsync(HttpMethods.GET, all, null).ConfigureAwait(false);
2626
}
2727

2828
[HttpPost]
2929
[Route("{*all}")]
3030
public async Task<HttpResponseMessage> PostAsync(string all, [FromBody]object body)
3131
{
32-
return await ProcessRequestAsync("POST", all, body).ConfigureAwait(false);
32+
return await ProcessRequestAsync(HttpMethods.POST, all, body).ConfigureAwait(false);
3333
}
3434

3535
[HttpDelete]
3636
[Route("{*all}")]
3737
public async Task<HttpResponseMessage> DeleteAsync(string all)
3838
{
39-
return await ProcessRequestAsync("DELETE", all, null).ConfigureAwait(false);
39+
return await ProcessRequestAsync(HttpMethods.DELETE, all, null).ConfigureAwait(false);
4040
}
4141

4242
[HttpPut]
4343
[Route("{*all}")]
4444
public async Task<HttpResponseMessage> PutAsync(string all, [FromBody]object body)
4545
{
46-
return await ProcessRequestAsync("PUT", all, body).ConfigureAwait(false);
46+
return await ProcessRequestAsync(HttpMethods.PUT, all, body).ConfigureAwait(false);
4747
}
4848

4949
[HttpPatch]
5050
[Route("{*all}")]
5151
public async Task<HttpResponseMessage> PatchAsync(string all, [FromBody]object body)
5252
{
53-
return await ProcessRequestAsync("PATCH", all, body).ConfigureAwait(false);
53+
return await ProcessRequestAsync(HttpMethods.PATCH, all, body).ConfigureAwait(false);
5454
}
5555

56-
private async Task<HttpResponseMessage> ProcessRequestAsync(string method, string all, object content)
56+
private async Task<HttpResponseMessage> ProcessRequestAsync(HttpMethods method, string all, object content)
5757
{
5858
var graphClient = GraphHelper.GetAuthenticatedClient();
5959

@@ -77,7 +77,7 @@ private async Task<HttpResponseMessage> ProcessRequestAsync(string method, strin
7777

7878
try
7979
{
80-
using (var response = await request.SendRequestAsync(content, CancellationToken.None, HttpCompletionOption.ResponseContentRead).ConfigureAwait(false))
80+
using (var response = await request.SendRequestAsync(content?.ToString(), CancellationToken.None, HttpCompletionOption.ResponseContentRead).ConfigureAwait(false))
8181
{
8282
response.Content.Headers.TryGetValues("content-type", out var contentTypes);
8383

0 commit comments

Comments
 (0)