Skip to content

Commit

Permalink
Jmprieur/fix tests in rel v2 (#2718)
Browse files Browse the repository at this point in the history
* Same as #2715, but for rel/v2

* Fix GUID
  • Loading branch information
jmprieur authored Mar 25, 2024
1 parent 576d895 commit 03f4973
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/DevApps/AzureFunctions/SampleFunc/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Instance": "https://login.microsoftonline.com/",
"Domain": "msidentitysamplestesting.onmicrosoft.com",
"TenantId": "7f58f645-c190-4ce5-9de4-e2b7acd2a6ab",
"ClientId": "e2fb196-50ce-4652-a4f9-26c1bf2e826b",
"ClientId": "1e2fb196-50ce-4652-a4f9-26c1bf2e826b",
"ClientSecret": "",
"AllowWebApiToBeAuthorizedByACL": false
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public async Task<ActionResult> SayHello()
var channel = GrpcChannel.ForAddress("https://localhost:5001");
var client = new Greeter.GreeterClient(channel);

string token = await _tokenAcquisition.GetAccessTokenForUserAsync(new string[] { "api://e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user" }).ConfigureAwait(false);
string token = await _tokenAcquisition.GetAccessTokenForUserAsync(new string[] { "api://1e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user" }).ConfigureAwait(false);

var headers = new Metadata();
headers.Add("Authorization", $"Bearer {token}");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@
},
"TodoList": {
// TodoListScope is the scope of the Web API you want to call.
"Scopes": [ "api://e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user" ],
"Scopes": [ "api://1e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user" ],
"BaseUrl": "http://localhost:44350"

},
"SayHello": {
// Scope for the web API set up w/gRPC
"Scopes": [ "api://e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user" ],
"Scopes": [ "api://1e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user" ],
"BaseUrl": "https://localhost:5001"
},
"AzureFunction": {
// Scope for the web API set up Azure function
"Scopes": [ "api://e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user" ],
"Scopes": [ "api://1e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user" ],
"BaseUrl": "http://localhost:7071/api/SampleFunc"
},
"TodoListJwe": {
// Scope for the web API used with the token decryption certificates.
"Scopes": [ "api://e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user" ],
"Scopes": [ "api://1e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user" ],
"BaseUrl": "https://localhost:44350"
},
"Logging": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// - WebAppsCallsWebApiCallGraph\\TodoListClient,
// - Navigate to the todo list. this provokes a 401.
// "Authority": "https://localhost:1234/v2.0",
"ClientId": "e2fb196-50ce-4652-a4f9-26c1bf2e826b", //"712ae8d7-548a-4306-95b6-ee9117ee86f0", JWE clientID
"ClientId": "1e2fb196-50ce-4652-a4f9-26c1bf2e826b", //"712ae8d7-548a-4306-95b6-ee9117ee86f0", JWE clientID
//"ClientSecret": null,
"ClientCertificates": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Instance": "https://login.microsoftonline.com/",
"Domain": "msidentitysamplestesting.onmicrosoft.com",
"TenantId": "7f58f645-c190-4ce5-9de4-e2b7acd2a6ab",
"ClientId": "e2fb196-50ce-4652-a4f9-26c1bf2e826b",
"ClientId": "1e2fb196-50ce-4652-a4f9-26c1bf2e826b",
"ClientCertificates": [
{
"SourceType": "KeyVault",
Expand Down
2 changes: 1 addition & 1 deletion tests/DevApps/aspnet-mvc/OwinWebApi/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Instance": "https://login.microsoftonline.com/",
"Domain": "msidentitysamplestesting.onmicrosoft.com",
"TenantId": "7f58f645-c190-4ce5-9de4-e2b7acd2a6ab",
"ClientId": "e2fb196-50ce-4652-a4f9-26c1bf2e826b", //"712ae8d7-548a-4306-95b6-ee9117ee86f0", JWE clientID
"ClientId": "1e2fb196-50ce-4652-a4f9-26c1bf2e826b", //"712ae8d7-548a-4306-95b6-ee9117ee86f0", JWE clientID
// "ClientSecret": "",
"Scopes": "access_as_user",
"EnableCacheSynchronization": false,
Expand Down
2 changes: 1 addition & 1 deletion tests/DevApps/blazorwasm2/Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static async Task Main(string[] args)
builder.Services.AddMsalAuthentication(options =>
{
builder.Configuration.Bind("AzureAd", options.ProviderOptions.Authentication);
options.ProviderOptions.DefaultAccessTokenScopes.Add("api://e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user");
options.ProviderOptions.DefaultAccessTokenScopes.Add("api://1e2fb196-50ce-4652-a4f9-26c1bf2e826b/access_as_user");
});

await builder.Build().RunAsync();
Expand Down
2 changes: 1 addition & 1 deletion tests/DevApps/blazorwasm2/Server/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Instance": "https://login.microsoftonline.com/",
"Domain": "msidentitysamplestesting.onmicrosoft.com",
"TenantId": "7f58f645-c190-4ce5-9de4-e2b7acd2a6ab",
"ClientId": "e2fb196-50ce-4652-a4f9-26c1bf2e826b",
"ClientId": "1e2fb196-50ce-4652-a4f9-26c1bf2e826b",
"CallbackPath": "/signin-oidc"
},
// },
Expand Down
2 changes: 1 addition & 1 deletion tests/DevApps/daemon-app/Daemon-app/Program-net60.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static async Task Main(string[] args)
// Get the token acquisition service
ITokenAcquirerFactory tokenAcquirerFactory = app.Services.GetRequiredService<ITokenAcquirerFactory>();
var tokenAcquirer = tokenAcquirerFactory.GetTokenAcquirer();
var result = await tokenAcquirer.GetTokenForAppAsync("api://e2fb196-50ce-4652-a4f9-26c1bf2e826b/.default");
var result = await tokenAcquirer.GetTokenForAppAsync("api://1e2fb196-50ce-4652-a4f9-26c1bf2e826b/.default");
Console.WriteLine($"Token expires on {result.ExpiresOn}");

#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"BaseUrl": "https://localhost:7060/",
"RelativePath": "/WeatherForecast",
"RequestAppToken": true,
"Scopes": [ "api://e2fb196-50ce-4652-a4f9-26c1bf2e826b/.default" ]
"Scopes": [ "api://1e2fb196-50ce-4652-a4f9-26c1bf2e826b/.default" ]
}
}
2 changes: 1 addition & 1 deletion tests/DevApps/daemon-app/minimal-web-api/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"TenantId": "7f58f645-c190-4ce5-9de4-e2b7acd2a6ab",
"ClientId": "e2fb196-50ce-4652-a4f9-26c1bf2e826b",
"ClientId": "1e2fb196-50ce-4652-a4f9-26c1bf2e826b",
"Scopes": "Weather.All",
"TokenDecryptionCredentials": [
]
Expand Down

0 comments on commit 03f4973

Please sign in to comment.