diff --git a/src/Microsoft.Identity.Web.Diagnostics/Properties/InternalsVisibleTo.cs b/src/Microsoft.Identity.Web.Diagnostics/Properties/InternalsVisibleTo.cs index 90599c2ca..47a95dfa6 100644 --- a/src/Microsoft.Identity.Web.Diagnostics/Properties/InternalsVisibleTo.cs +++ b/src/Microsoft.Identity.Web.Diagnostics/Properties/InternalsVisibleTo.cs @@ -14,3 +14,4 @@ [assembly: InternalsVisibleTo("Microsoft.Identity.Web.TokenCache, PublicKey=00240000048000009400000006020000002400005253413100040000010001002D96616729B54F6D013D71559A017F50AA4861487226C523959D1579B93F3FDF71C08B980FD3130062B03D3DE115C4B84E7AC46AEF5E192A40E7457D5F3A08F66CEAB71143807F2C3CB0DA5E23B38F0559769978406F6E5D30CEADD7985FC73A5A609A8B74A1DF0A29399074A003A226C943D480FEC96DBEC7106A87896539AD")] [assembly: InternalsVisibleTo("Microsoft.Identity.Web.UI, PublicKey=00240000048000009400000006020000002400005253413100040000010001002D96616729B54F6D013D71559A017F50AA4861487226C523959D1579B93F3FDF71C08B980FD3130062B03D3DE115C4B84E7AC46AEF5E192A40E7457D5F3A08F66CEAB71143807F2C3CB0DA5E23B38F0559769978406F6E5D30CEADD7985FC73A5A609A8B74A1DF0A29399074A003A226C943D480FEC96DBEC7106A87896539AD")] [assembly: InternalsVisibleTo("Microsoft.Identity.Web.OWIN, PublicKey=00240000048000009400000006020000002400005253413100040000010001002D96616729B54F6D013D71559A017F50AA4861487226C523959D1579B93F3FDF71C08B980FD3130062B03D3DE115C4B84E7AC46AEF5E192A40E7457D5F3A08F66CEAB71143807F2C3CB0DA5E23B38F0559769978406F6E5D30CEADD7985FC73A5A609A8B74A1DF0A29399074A003A226C943D480FEC96DBEC7106A87896539AD")] +[assembly: InternalsVisibleTo("TokenAcquirerTests, PublicKey=00240000048000009400000006020000002400005253413100040000010001002d96616729b54f6d013d71559a017f50aa4861487226c523959d1579b93f3fdf71c08b980fd3130062b03d3de115c4b84e7ac46aef5e192a40e7457d5f3a08f66ceab71143807f2c3cb0da5e23b38f0559769978406f6e5d30ceadd7985fc73a5a609a8b74a1df0a29399074a003a226c943d480fec96dbec7106a87896539ad")] diff --git a/tests/IntegrationTests/TokenAcquirerTests/TokenAcquirer.cs b/tests/IntegrationTests/TokenAcquirerTests/TokenAcquirer.cs index aca2e6e66..fef611b37 100644 --- a/tests/IntegrationTests/TokenAcquirerTests/TokenAcquirer.cs +++ b/tests/IntegrationTests/TokenAcquirerTests/TokenAcquirer.cs @@ -135,7 +135,7 @@ public async Task AcquireTokenWithPop_ClientCredentialsAsync() services.AddInMemoryTokenCaches(); var serviceProvider = tokenAcquirerFactory.Build(); var options = serviceProvider.GetRequiredService>().Get(s_optionName); - var credentialsLoader= serviceProvider.GetRequiredService(); + var credentialsLoader = serviceProvider.GetRequiredService(); await credentialsLoader.LoadCredentialsIfNeededAsync(options.ClientCredentials!.First()); var cert = options.ClientCredentials!.First().Certificate; @@ -173,7 +173,7 @@ public async Task AcquireTokenWithMs10AtPop_ClientCredentialsAsync() RsaSecurityKey rsaSecurityKey = CreateRsaSecurityKey(); var result = await tokenAcquirer.GetTokenForAppAsync("https://graph.microsoft.com/.default", new TokenAcquisitionOptions() - { + { PopPublicKey = rsaSecurityKey.KeyId, JwkClaim = CreateJwkClaim(rsaSecurityKey, SecurityAlgorithms.RsaSha256) }); @@ -203,6 +203,9 @@ private static RsaSecurityKey CreateRsaSecurityKey() private static string CreateRsaKeyId(RSAParameters rsaParameters) { + Throws.IfNull(rsaParameters.Exponent); + Throws.IfNull(rsaParameters.Modulus); + byte[] kidBytes = new byte[rsaParameters.Exponent.Length + rsaParameters.Modulus.Length]; Array.Copy(rsaParameters.Exponent, 0, kidBytes, 0, rsaParameters.Exponent.Length); Array.Copy(rsaParameters.Modulus, 0, kidBytes, rsaParameters.Exponent.Length, rsaParameters.Modulus.Length);