Skip to content

Commit 78d0087

Browse files
authored
Fixes #3470 (#3471)
* Fixes #3470 Tested manually with a client secret. * Fixing typo * Update Directory.Build.props * Update changelog for version 3.14.1
1 parent 4d061a0 commit 78d0087

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<!--This should be passed from the VSTS build-->
44
<!-- This needs to be greater than or equal to the validation baseline version -->
5-
<MicrosoftIdentityWebVersion Condition="'$(MicrosoftIdentityWebVersion)' == ''">3.13.2</MicrosoftIdentityWebVersion>
5+
<MicrosoftIdentityWebVersion Condition="'$(MicrosoftIdentityWebVersion)' == ''">3.14.1</MicrosoftIdentityWebVersion>
66
<!--This will generate AssemblyVersion, AssemblyFileVersion and AssemblyInformationVersion-->
77
<Version>$(MicrosoftIdentityWebVersion)</Version>
88

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
3.14.1
2+
=======
3+
## Bug fix
4+
- Support client secrets with agent user identities. See [#3470](https://github.com/AzureAD/microsoft-identity-web/issues/3470) for details.
5+
16
3.14.0
27
=======
38
## New features

src/Microsoft.Identity.Web.AgentIdentities/AgentUserIdentityMsalAddIn.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ internal static Task OnBeforeUserFicForAgentUserIdentityAsync(
7070
request.BodyParameters["grant_type"] = "user_fic";
7171
request.BodyParameters.Remove("password");
7272

73-
if (request.BodyParameters.TryGetValue("client_secret", out var secret)
74-
&& secret.Equals("default", StringComparison.OrdinalIgnoreCase))
73+
if (request.BodyParameters.TryGetValue("client_secret", out var secret))
7574
{
7675
request.BodyParameters.Remove("client_secret");
7776
}

src/Microsoft.Identity.Web.TokenAcquisition/TokenAcquisition.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,12 @@ public async Task RemoveAccountAsync(
869869
private bool IsInvalidClientCertificateOrSignedAssertionError(MsalServiceException exMsal)
870870
{
871871
return !_retryClientCertificate &&
872-
string.Equals(exMsal.ErrorCode, Constants.InvalidClient, StringComparison.OrdinalIgnoreCase);
872+
string.Equals(exMsal.ErrorCode, Constants.InvalidClient, StringComparison.OrdinalIgnoreCase) &&
873+
!exMsal.ResponseBody.Contains("AADSTS7000215" // No retry when wrong client secret.
874+
#if NET6_0_OR_GREATER
875+
, StringComparison.OrdinalIgnoreCase
876+
#endif
877+
);
873878
}
874879

875880

0 commit comments

Comments
 (0)