Skip to content

Commit 648a505

Browse files
Copilotjmprieur
andauthored
Update E2E agent identity configuration to new tenant (#3646)
* Initial plan * Update agent identity configuration to new tenant and credentials Co-authored-by: jmprieur <[email protected]> * Fix AgentIdentity to use correct value (ab18ca07-d139-4840-8b3b-4be9610c6ed5) Co-authored-by: jmprieur <[email protected]> * Fix User Object ID to complete GUID (a02b9a5b-ea57-40c9-bf00-8aa631b549ad) Co-authored-by: jmprieur <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jmprieur <[email protected]> Co-authored-by: Jean-Marc Prieur <[email protected]>
1 parent 55b01e3 commit 648a505

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

tests/E2E Tests/AgentApplications/AgentUserIdentityTestscs.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace AgentApplicationsTests
1919
public class AgentUserIdentityTests
2020
{
2121
string instance = "https://login.microsoftonline.com/";
22-
string tenantId = "31a58c3b-ae9c-4448-9e8f-e9e143e800df"; // Replace with your tenant ID
23-
string agentApplication = "d05619c9-dbf2-4e60-95fd-cc75dd0db451"; // Replace with the actual agent application client ID
24-
string agentIdentity = "edbfbbe7-d240-40dd-aee2-435201dbaa9c"; // Replace with the actual agent identity
25-
string userUpn = "agentuser1@msidlabtoint.onmicrosoft.com"; // Replace with the actual user upn.
22+
string tenantId = "10c419d4-4a50-45b2-aa4e-919fb84df24f"; // Replace with your tenant ID
23+
string agentApplication = "aab5089d-e764-47e3-9f28-cc11c2513821"; // Replace with the actual agent application client ID
24+
string agentIdentity = "ab18ca07-d139-4840-8b3b-4be9610c6ed5"; // Replace with the actual agent identity
25+
string userUpn = "agentuser1@id4slab1.onmicrosoft.com"; // Replace with the actual user upn.
2626

2727
[Fact]
2828
public async Task AgentUserIdentityGetsTokenForGraphAsync()
@@ -254,7 +254,7 @@ public async Task AgentUserIdentityGetsTokenForGraphWithCacheAsync()
254254
[Fact]
255255
public async Task AgentUserIdentityGetsTokenForGraphByUserIdAsync()
256256
{
257-
string userOid = "03d648e4-2e01-4dfb-b21d-81eb678fbcf4"; // Replace with the actual user OID.
257+
string userOid = "a02b9a5b-ea57-40c9-bf00-8aa631b549ad"; // Replace with the actual user OID.
258258

259259
IServiceCollection services = new ServiceCollection();
260260

tests/E2E Tests/AgentApplications/AutonomousAgentTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ namespace AgentApplicationsTests
1515
{
1616
public class AutonomousAgentTests
1717
{
18-
const string overriddenTenantId = "31a58c3b-ae9c-4448-9e8f-e9e143e800df";
18+
const string overriddenTenantId = "10c419d4-4a50-45b2-aa4e-919fb84df24f";
1919
[Theory]
2020
[InlineData("organizations")]
21-
[InlineData("31a58c3b-ae9c-4448-9e8f-e9e143e800df")]
21+
[InlineData("10c419d4-4a50-45b2-aa4e-919fb84df24f")]
2222
public async Task AutonomousAgentGetsAppTokenForAgentIdentityToCallGraphAsync(string configuredTenantId)
2323
{
2424
IServiceCollection services = new ServiceCollection();
2525
IConfiguration configuration = new ConfigurationBuilder().AddInMemoryCollection().Build();
2626

2727
configuration["AzureAd:Instance"] = "https://login.microsoftonline.com/";
2828
configuration["AzureAd:TenantId"] = configuredTenantId; // Set to the GUID or organizations
29-
configuration["AzureAd:ClientId"] = "d05619c9-dbf2-4e60-95fd-cc75dd0db451"; // Agent application.
29+
configuration["AzureAd:ClientId"] = "aab5089d-e764-47e3-9f28-cc11c2513821"; // Agent application.
3030
configuration["AzureAd:ClientCredentials:0:SourceType"] = "StoreWithDistinguishedName";
3131
configuration["AzureAd:ClientCredentials:0:CertificateStorePath"] = "LocalMachine/My";
3232
configuration["AzureAd:ClientCredentials:0:CertificateDistinguishedName"] = "CN=LabAuth.MSIDLab.com";
@@ -41,7 +41,7 @@ public async Task AutonomousAgentGetsAppTokenForAgentIdentityToCallGraphAsync(st
4141
services.AddMicrosoftGraph(); // If you want to call Microsoft Graph
4242
var serviceProvider = services.BuildServiceProvider();
4343

44-
string agentIdentity = "edbfbbe7-d240-40dd-aee2-435201dbaa9c"; // Replace with the actual agent identity
44+
string agentIdentity = "ab18ca07-d139-4840-8b3b-4be9610c6ed5"; // Replace with the actual agent identity
4545

4646
//// Get an authorization header and handle the call to the downstream API yoursel
4747
IAuthorizationHeaderProvider authorizationHeaderProvider = serviceProvider.GetService<IAuthorizationHeaderProvider>()!;

tests/E2E Tests/AgentApplications/GetFicAsyncTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ public class GetFicAsyncTests
1717
public async Task GetFicTokensTestsAsync()
1818
{
1919
string instance = "https://login.microsoftonline.com/";
20-
string tenantId = "31a58c3b-ae9c-4448-9e8f-e9e143e800df"; // Replace with your tenant ID
21-
string agentApplication = "d05619c9-dbf2-4e60-95fd-cc75dd0db451"; // Replace with the actual agent application client ID
22-
string agentIdentity = "edbfbbe7-d240-40dd-aee2-435201dbaa9c"; // Replace with the actual agent identity
20+
string tenantId = "10c419d4-4a50-45b2-aa4e-919fb84df24f"; // Replace with your tenant ID
21+
string agentApplication = "aab5089d-e764-47e3-9f28-cc11c2513821"; // Replace with the actual agent application client ID
22+
string agentIdentity = "ab18ca07-d139-4840-8b3b-4be9610c6ed5"; // Replace with the actual agent identity
2323

2424
IServiceCollection services = new ServiceCollection();
2525

tests/E2E Tests/Sidecar.Tests/SidecarApiFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ internal SidecarApiFactory(Action<IConfigurationBuilder>? configureOptions)
2424
builder.AddInMemoryCollection(new Dictionary<string, string?>
2525
{
2626
{ "AzureAd:Instance", "https://login.microsoftonline.com/" },
27-
{ "AzureAd:TenantId", "31a58c3b-ae9c-4448-9e8f-e9e143e800df" },
28-
{ "AzureAd:ClientId", "d05619c9-dbf2-4e60-95fd-cc75dd0db451" },
29-
{ "AzureAd:Audience", "d05619c9-dbf2-4e60-95fd-cc75dd0db451" },
27+
{ "AzureAd:TenantId", "10c419d4-4a50-45b2-aa4e-919fb84df24f" },
28+
{ "AzureAd:ClientId", "aab5089d-e764-47e3-9f28-cc11c2513821" },
29+
{ "AzureAd:Audience", "aab5089d-e764-47e3-9f28-cc11c2513821" },
3030
{ "AzureAd:AllowWebApiToBeAuthorizedByACL", "true" },
3131
{ "AzureAd:ClientCredentials:0:SourceType", "StoreWithDistinguishedName" },
3232
{ "AzureAd:ClientCredentials:0:CertificateStorePath", "LocalMachine/My" },

tests/E2E Tests/Sidecar.Tests/SidecarEndpointsE2ETests.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ public class SidecarEndpointsE2ETests : IClassFixture<SidecarApiFactory>
2222

2323
public SidecarEndpointsE2ETests(SidecarApiFactory factory) => _factory = factory;
2424

25-
const string TenantId = "31a58c3b-ae9c-4448-9e8f-e9e143e800df"; // Replace with your tenant ID
26-
const string AgentApplication = "d05619c9-dbf2-4e60-95fd-cc75dd0db451"; // Replace with the actual agent application client ID
27-
const string AgentIdentity = "edbfbbe7-d240-40dd-aee2-435201dbaa9c"; // Replace with the actual agent identity
28-
const string UserUpn = "agentuser1@msidlabtoint.onmicrosoft.com"; // Replace with the actual user upn.
29-
string UserOid = "03d648e4-2e01-4dfb-b21d-81eb678fbcf4"; // Replace with the actual user OID.
25+
const string TenantId = "10c419d4-4a50-45b2-aa4e-919fb84df24f"; // Replace with your tenant ID
26+
const string AgentApplication = "aab5089d-e764-47e3-9f28-cc11c2513821"; // Replace with the actual agent application client ID
27+
const string AgentIdentity = "ab18ca07-d139-4840-8b3b-4be9610c6ed5"; // Replace with the actual agent identity
28+
const string UserUpn = "agentuser1@id4slab1.onmicrosoft.com"; // Replace with the actual user upn.
29+
string UserOid = "a02b9a5b-ea57-40c9-bf00-8aa631b549ad"; // Replace with the actual user OID.
3030

3131
[Fact]
3232
public async Task Validate_WhenBadTokenAsync()
@@ -175,7 +175,7 @@ private static async Task<string> GetAuthorizationHeaderToCallTheSideCarAsync()
175175
IConfiguration configuration = new ConfigurationBuilder().AddInMemoryCollection().Build();
176176
services.AddSingleton<IConfiguration>(configuration);
177177
configuration["Instance"] = "https://login.microsoftonline.com/";
178-
configuration["TenantId"] = "31a58c3b-ae9c-4448-9e8f-e9e143e800df";
178+
configuration["TenantId"] = "10c419d4-4a50-45b2-aa4e-919fb84df24f";
179179
configuration["ClientId"] = "5cbcd9ff-c994-49ac-87e7-08a93a9c0794";
180180
configuration["SendX5C"] = "true";
181181
configuration["ClientCredentials:0:SourceType"] = "StoreWithDistinguishedName";
@@ -187,7 +187,7 @@ private static async Task<string> GetAuthorizationHeaderToCallTheSideCarAsync()
187187
IServiceProvider serviceProvider = services.BuildServiceProvider();
188188

189189
IAuthorizationHeaderProvider authorizationHeaderProvider = serviceProvider.GetRequiredService<IAuthorizationHeaderProvider>();
190-
string authorizationHeader = await authorizationHeaderProvider.CreateAuthorizationHeaderForAppAsync("api://d05619c9-dbf2-4e60-95fd-cc75dd0db451/.default",
190+
string authorizationHeader = await authorizationHeaderProvider.CreateAuthorizationHeaderForAppAsync("api://aab5089d-e764-47e3-9f28-cc11c2513821/.default",
191191
new AuthorizationHeaderProviderOptions()
192192
{
193193
AcquireTokenOptions = new AcquireTokenOptions()

0 commit comments

Comments
 (0)