Skip to content

feat: auth0-php v9 compatibility (6.x beta groundwork)#242

Open
kishore7snehil wants to merge 4 commits into
v6from
feat/v9-compat
Open

feat: auth0-php v9 compatibility (6.x beta groundwork)#242
kishore7snehil wants to merge 4 commits into
v6from
feat/v9-compat

Conversation

@kishore7snehil

@kishore7snehil kishore7snehil commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Auth0 Symfony SDK - auth0-php v9 compatibility

This PR moves the bundle onto auth0-php v9 and lands the groundwork for the upcoming 6.x major. It targets the v6 mainline branch. Version bumps (.version, Service::VERSION, CHANGELOG) are intentionally not included here - those ship in a separate release/6.0.0-beta.0 PR, mirroring the auth0-php release model.

What's New

  • auth0-php v9: the bundle now requires auth0/auth0-php ^9.0@beta, whose Management API is generated from Auth0's OpenAPI specs (typed requests/responses, property-access sub-clients, pagers).
  • Service::getManagement(): a new accessor that returns a v9 Management client built from the bundle's existing domain / client_id / client_secret configuration. It fetches and caches a client-credentials token for you.
  • PHP 8.2+: the supported PHP floor is raised to 8.2.
  • Refreshed 6.4 LTS example: the sample app is rebuilt onto Symfony 6.4 with a lean bundle set and a Management API explorer demonstrating getManagement().

Breaking Changes

Area 5.x 6.x
auth0/auth0-php ^8.19 ^9.0
PHP ^8.1 >=8.2
Management access $auth0->getSdk()->management() $auth0->getManagement()
Management responses raw PSR-7, HttpResponse::decodeContent() typed objects

The v8-style getSdk()->management() is non-functional in auth0-php v9 and throws a TypeError. Use getManagement() instead.

What's NOT Affected

Authentication flows are unchanged. The authenticator, authorizer, user provider, session store, and the bundled authentication controllers behave exactly as they did in 5.x. Login, callback, profile, and logout were verified end-to-end against v9.

Migration Example

// 5.x
$management = $auth0->getSdk()->management();
$response = $management->users()->getAll(['per_page' => 25]);
$users = HttpResponse::decodeContent($response);

// 6.x
$management = $auth0->getManagement();
$users = $management->users->list(
    new ListUsersRequestParameters(['perPage' => 25])
);
foreach ($users as $user) {
    echo $user->getEmail();
}

Documentation

  • README.md: PHP 8.2 requirement, a new "Accessing the Management API" section, and a consolidated support table.
  • UPGRADING.md: a new "5.x to 6.x" section covering the dependency bump and the Management API migration.

CI

  • tests.yml now also runs on pushes to v6 (PRs into v6 already run via the unfiltered pull_request trigger).

Beta Notice

This is groundwork for a beta release. While the authentication surface is stable, the Management API in auth0-php v9 is itself in beta and minor adjustments may occur before the final 6.0.0.

Adds a Service::getManagement() accessor returning a v9 Management API
client built from the bundle's existing configuration, since the
v8-style getSdk()->management() is non-functional in auth0-php v9.

- Require auth0/auth0-php ^9.0@beta and raise the PHP floor to 8.2
- Document the Management API usage and 5.x to 6.x upgrade path
- Rebuild the 6.4 LTS example onto Symfony 6.4 with a Management demo
- Run CI on the v6 branch
@kishore7snehil
kishore7snehil requested a review from a team as a code owner June 11, 2026 21:25
Run phpcs:fix on Service.php (grouped imports, property/method ordering).
Comment out the rl-scanner job in release.yml since the RL scanner trust
policy only covers main/master, not the v6 branch. Documented that the job
must be re-enabled once v6 goes GA and merges into main.
The migration guide (v9_MIGRATION_GUIDE.md) and API reference (reference.md)
only exist on auth0-php's v9 branch, not main. Point the README and UPGRADING
links there so they resolve until v9 is merged to main.
rector/rector 2.5.3+ deprecated JoinStringConcatRector and throws a fatal
system error when it is registered, breaking the Rector CI job. Upstream
removed the rule with no replacement (stylistic, deemed too context-
dependent to generalize), so remove it from the config. No src changes.
Comment thread UPGRADING.md
| **auth0/auth0-php** | `^8.19` | `^9.0` |

- Please ensure you are running PHP 8.2 or newer. Support for PHP 8.1 has been dropped.
- Composer will pull in `auth0/auth0-php` v9 automatically. No package rename is required; the package remains `auth0/auth0-php`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

composer.json mentions the version as ^9.0@beta". Is that intentional?

Comment thread src/Service.php
@@ -16,6 +17,8 @@ final class Service implements ServiceInterface
{
public const VERSION = '5.9.0';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to change this version to 6.x.x?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants