Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for Client Secret #304

Merged
merged 6 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/Auth0.OidcClient.Core/Auth0ClientBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,6 @@ private OidcClientOptions CreateOidcClientOptions(Auth0ClientOptions options)
}
};

#pragma warning disable CS0618 // ClientSecret will be removed in a future update.
if (!String.IsNullOrWhiteSpace(oidcClientOptions.ClientSecret))
oidcClientOptions.ClientSecret = options.ClientSecret;
#pragma warning restore CS0618

if (options.RefreshTokenMessageHandler != null)
oidcClientOptions.RefreshTokenInnerHttpHandler = options.RefreshTokenMessageHandler;

Expand Down
7 changes: 0 additions & 7 deletions src/Auth0.OidcClient.Core/Auth0ClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@ public class Auth0ClientOptions
/// </summary>
public string ClientId { get; set; }

/// <summary>
/// Your Auth0 Client Secret.
/// </summary>
[Obsolete("Client Secrets should not be used in non-confidential clients such as native desktop and mobile apps. " +
"This property will be removed in a future release.")]
public string ClientSecret { get; set; }

/// <summary>
/// Your Auth0 tenant domain.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Auth0.OidcClient.Core/Tokens/IdTokenValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ internal async Task AssertTokenMeetsRequirements(IdTokenRequirements required, s

var token = DecodeToken(rawIDToken);

// For now we want to support HS256 + ClientSecret as we just had a major release.
// TODO: In the next major (v4.0) we should remove this condition as well as Auth0ClientOptions.ClientSecret
// Signature Verification is optional because the token endpoint is over HTTPS.
// As we allow HS256 signed Id token, but we do not have a Client Secret we skip signature verification for HS256.
if (token.SignatureAlgorithm != "HS256")
(signatureVerifier ?? await assymetricSignatureVerifier.ForJwks(required.Issuer)).VerifySignature(rawIDToken);

Expand Down
Loading