Skip to content

Commit e0da46f

Browse files
committed
fix build errors
1 parent 318504b commit e0da46f

File tree

7 files changed

+6
-10
lines changed

7 files changed

+6
-10
lines changed

2. Web API now calls Microsoft Graph/TodoListService/Controllers/TodoListController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public async Task<string> CallGraphApiOnBehalfOfUser()
9292
// we use MSAL.NET to get a token to call the API On Behalf Of the current user
9393
try
9494
{
95-
string accessToken = await _tokenAcquisition.GetAccessTokenOnBehalfOfUserAsync(scopes);
95+
string accessToken = await _tokenAcquisition.GetAccessTokenForUserAsync(scopes);
9696
dynamic me = await CallGraphApiOnBehalfOfUser(accessToken);
9797
return me.userPrincipalName;
9898
}

2. Web API now calls Microsoft Graph/TodoListService/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public Startup(IConfiguration configuration)
2424
public void ConfigureServices(IServiceCollection services)
2525
{
2626
services.AddProtectedWebApi(Configuration)
27-
.AddProtectedApiCallsWebApis(Configuration)
27+
.AddProtectedWebApiCallsProtectedWebApi(Configuration)
2828
.AddInMemoryTokenCaches();
2929
services.AddControllers();
3030
}

3.-Web-api-call-Microsoft-graph-for-personal-accounts/TodoListService/Controllers/TodoListController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public async Task<string> CallGraphApiOnBehalfOfUser()
9292
// we use MSAL.NET to get a token to call the API On Behalf Of the current user
9393
try
9494
{
95-
string accessToken = await _tokenAcquisition.GetAccessTokenOnBehalfOfUserAsync(scopes);
95+
string accessToken = await _tokenAcquisition.GetAccessTokenForUserAsync(scopes);
9696
dynamic me = await CallGraphApiOnBehalfOfUser(accessToken);
9797
return me.userPrincipalName;
9898
}

3.-Web-api-call-Microsoft-graph-for-personal-accounts/TodoListService/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public Startup(IConfiguration configuration)
2424
public void ConfigureServices(IServiceCollection services)
2525
{
2626
services.AddProtectedWebApi(Configuration)
27-
.AddProtectedApiCallsWebApis(Configuration)
27+
.AddProtectedWebApiCallsProtectedWebApi(Configuration)
2828
.AddInMemoryTokenCaches();
2929
services.AddControllers();
3030
}

4.-Console-app-calls-web-API-with-PoP/TodoListService/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public Startup(IConfiguration configuration)
2424
public void ConfigureServices(IServiceCollection services)
2525
{
2626
services.AddProtectedWebApi(Configuration)
27-
.AddProtectedApiCallsWebApis(Configuration)
27+
.AddProtectedWebApiCallsProtectedWebApi(Configuration)
2828
.AddPop(Configuration)
2929
.AddInMemoryTokenCaches();
3030
services.AddControllers();

Microsoft.Identity.Web/Microsoft.Identity.Web.Future.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
<PackageReference Include="Microsoft.AspNetCore.Authentication.AzureAD.UI" Version="3.1.0" />
8383
<PackageReference Include="Microsoft.AspNetCore.Authentication.AzureADB2C.UI" Version="3.1.0" />
8484
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.3" />
85-
<PackageReference Include="Microsoft.Identity.Client" Version="4.10.0" />
85+
<PackageReference Include="Microsoft.Identity.Client" Version="4.11.0" />
8686
<PackageReference Include="Microsoft.Identity.Web" Version="0.1.0-preview" />
8787
<PackageReference Include="Microsoft.IdentityModel.Protocols.SignedHttpRequest" Version="6.5.0" />
8888
<PackageReference Include="System.Collections" Version="4.3.0" />

Microsoft.Identity.Web/WebApiServiceCollectionExtensions.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ public static IServiceCollection AddPop(
4848
{
4949
options.ClientId, $"api://{options.ClientId}"
5050
};
51-
52-
// Instead of using the default validation (validating against a single tenant, as we do in line of business apps),
53-
// we inject our own multi-tenant validation logic (which even accepts both v1.0 and v2.0 tokens)
54-
options.AccessTokenValidationParameters.IssuerValidator = AadIssuerValidator.GetIssuerValidator(options.Authority).Validate;
5551
});
5652

5753
return services;

0 commit comments

Comments
 (0)