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

feat(Authentication): Add support for Client Assertion #699

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

evansims
Copy link
Member

@evansims evansims commented Jan 22, 2023

Description

This PR adds support for Client Assertion, as an alternative to using Client Secrets, when making requests against the Authentication API.

Changes include the introduction of two new SDK configuration properties:

  • clientAssertionSigningKey, which accepts an OpenSSLAsymmetricKey object, a PEM formatted private key as a string, a file path to a PEM certificate (e.g. file://path/to/file.pem), or null to disable the feature. Defaults to null.
  • clientAssertionSigningAlgorithm, which accepts a string. Defaults to RS256.

When configured, the clientAssertionSigningKey will take precedence over any configured clientSecret, where appropriate.

When passing a string as the value to clientAssertionSigningKey, the format can be anything the OpenSSL openssl_pkey_get_private()

Changes also include a new class, Auth0\SDK\Token\ClientAssertionGenerator. This is a template interstitial for Auth0\SDK\Token\Generator that will apply the necessary configuration to create a JSON Web Token appropriate for use with the Client Assertion feature.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist

@evansims evansims added this to the 8.4.0 milestone Jan 22, 2023
@github-actions
Copy link
Contributor

👋 Thanks for contributing! Please be patient while a maintainer reviews your PR. In the meantime, please make sure you've read our contributing guide.

@github-actions github-actions bot added the Scope: Improvement Code changes including new features or enhancements to the library. label Jan 22, 2023
@codecov-commenter
Copy link

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (87a7de7) compared to base (2e23ec4).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##                main      #699   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity      1282      1282           
===========================================
  Files             66        66           
  Lines           4498      4498           
===========================================
  Hits            4498      4498           
Impacted Files Coverage Δ
src/API/Authentication.php 100.00% <100.00%> (ø)
src/Configuration/SdkConfiguration.php 100.00% <100.00%> (ø)
src/Token/Generator.php 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@evansims evansims marked this pull request as ready for review January 22, 2023 09:31
@evansims evansims requested a review from a team as a code owner January 22, 2023 09:31
@evansims evansims changed the title feat: Add support for Client Assertion feat(Authentication): Add support for Client Assertion Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Improvement Code changes including new features or enhancements to the library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants