auth0 / auth0-PHP

PHP SDK for Auth0 Authentication and Management APIs.
https://auth0.com/docs/libraries/auth0-php
MIT License
381 stars 210 forks source link

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

Closed evansims closed 1 year ago

evansims commented 1 year ago

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:

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

Checklist

github-actions[bot] commented 1 year ago

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

codecov-commenter commented 1 year ago

Codecov Report

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

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 ```diff @@ Coverage Diff @@ ## main #699 +/- ## =========================================== Coverage 100.00% 100.00% Complexity 1282 1282 =========================================== Files 66 66 Lines 4498 4498 =========================================== Hits 4498 4498 ``` | [Impacted Files](https://codecov.io/gh/auth0/auth0-PHP/pull/699?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=auth0) | Coverage Δ | | |---|---|---| | [src/API/Authentication.php](https://codecov.io/gh/auth0/auth0-PHP/pull/699?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=auth0#diff-c3JjL0FQSS9BdXRoZW50aWNhdGlvbi5waHA=) | `100.00% <100.00%> (ø)` | | | [src/Configuration/SdkConfiguration.php](https://codecov.io/gh/auth0/auth0-PHP/pull/699?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=auth0#diff-c3JjL0NvbmZpZ3VyYXRpb24vU2RrQ29uZmlndXJhdGlvbi5waHA=) | `100.00% <100.00%> (ø)` | | | [src/Token/Generator.php](https://codecov.io/gh/auth0/auth0-PHP/pull/699?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=auth0#diff-c3JjL1Rva2VuL0dlbmVyYXRvci5waHA=) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=auth0). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=auth0)

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