auth0/auth0-php
Auth0 PHP SDK for integrating Auth0 Authentication and Management APIs. Build login/logout flows, validate tokens, and manage users, roles, and applications. Works with any PHP app, with tailored SDKs available for Laravel, Symfony, and WordPress.
Added
Added
Fixed
Breaking Changes
Added
Fixed
Added
Added
⚠️ This is a beta release. It introduces breaking changes to the Management API. The Authentication API is unchanged. Please consult the v9 Migration Guide for detailed upgrade instructions.
This release marks a major milestone for the Auth0 PHP SDK: the Management API client has been completely rewritten using the Fern code generation tool, built directly from the Auth0 OpenAPI specification. This delivers complete, always-up-to-date API coverage with full type safety.
Pager<T> implements IteratorAggregate, automatically fetching pages as you iterate with foreachManagementClient wrapper handles OAuth 2.0 client credentials grant, token caching (PSR-6), and custom token providers out of the boxAuth0ApiException with status code and response body, replacing manual status code checksThe Authentication API is completely unchanged. Auth0\SDK\Auth0, session handling, token verification, and all authentication flows work exactly as before.
The Management API has breaking changes:
| Area | v8 | v9 |
|---|---|---|
| Sub-client access | $mgmt->users()->getAll() |
$client->users->list() |
| Request params | Associative arrays | Typed classes (ListUsersRequestParameters) |
| Responses | ResponseInterface + json_decode() |
Typed objects ($user->getEmail()) |
| Pagination | HttpResponsePaginator |
foreach ($pager as $user) |
| Error handling | Check $response->getStatusCode() |
catch (Auth0ApiException $e) |
| Initialization | $auth0->management() via SdkConfiguration |
new ManagementClient(new ManagementClientOptions(...)) |
composer require auth0/auth0-php:9.0.0-beta.0
Running
composer require auth0/auth0-phpwithout a version constraint will install the latest stable v8 release.
use Auth0\SDK\API\Management\Wrapper\ManagementClient;
use Auth0\SDK\API\Management\Wrapper\ManagementClientOptions;
use Auth0\SDK\API\Management\Users\Requests\ListUsersRequestParameters;
$client = new ManagementClient(new ManagementClientOptions(
domain: 'tenant.auth0.com',
clientId: 'CLIENT_ID',
clientSecret: 'CLIENT_SECRET',
));
// List users with automatic pagination
$pager = $client->users->list(new ListUsersRequestParameters([
'perPage' => 50,
'includeTotals' => true,
]));
foreach ($pager as $user) {
echo $user->getEmail();
}
ResponseInterface->users) instead of methods (->users())getAll() renamed to list() across all endpointsHttpResponsePaginator replaced by Pager<T>Auth0ApiException automaticallyThis is a beta release - we would love your feedback! Please open an issue if you encounter any problems or have suggestions.
Fixed
Changed
Security fix: Resolve CVE-2025-68129
Security fix: Resolve CVE-2025-58769
Added
Fixed
Added
https://github.com/auth0/auth0-PHP/pull/782 (kishore7snehil)
https://github.com/auth0/auth0-PHP/pull/783 (kishore7snehil)
Fixed
Adding client credentials support #775 (kishore7snehil)
Adding Support For CYOK #779 (kishore7snehil)
Fixed
Added
Fixed
Fixed
Added
Note ¹ To use this feature, an Auth0 tenant must have support for it enabled. This feature is not yet available to all tenants.
Added
Auth0\SDK\API\Authentication\PushedAuthorizationRequest is a new class for issuing Pushed Authorization Requests and producing authorization links for them.Auth0\SDK\API\Authentication::pushedAuthorizationRequest() has been added as a shortcut method for returning a configured instantiation of the above class.Auth0\SDK\Auth0::login() has been updated to support issuing Pushed Authorization Requests and returning authorization links for them.Auth0\SDK\Configuration\SdkConfiguration has been updated to accept a pushedAuthorizationRequest boolean to enable this feature.Auth0\SDK\Auth0::isAuthenticated() has been added as a shortcut method. It is an alias for getCredentials() !== null.¹ Note: To use this feature, an Auth0 tenant must have support for it enabled. This feature is not yet available to all tenants.
This release improves the SDK's automatic discovery process of compatible HTTP clients, factories and messages (PSR-18, 17 and 7, respectively). If you encounter issues with your implementation not being discovered, please open an issue.
This release also introduces support for a number of additional Management API endpoints.
Added
State Management
Auth0\SDK\Auth0::refreshState() to force a refresh of the SDK's internal state. This is useful when you have updated the SDK's configuration and want to ensure the SDK is using the latest values.Management API
Auth0\APIs\Management\Users
DELETE /users/:id/authenticators → deleteAllAuthenticators() (#702) (Documentation)GET /api/v2/users/:user/authentication-methods → getAuthenticationMethods() (Documentation)PUT /api/v2/users/:user/authentication-methods → replaceAuthenticationMethods() (Documentation)DELETE /api/v2/users/:user/authentication-methods → deleteAuthenticationMethods(string user) (Documentation)POST /api/v2/users/:user/authentication-methods → createAuthenticationMethod() (Documentation)GET /api/v2/users/:user/authentication-methods/:method → getAuthenticationMethod() (Documentation)PATCH /api/v2/users/:user/authentication-methods/:method → updateAuthenticationMethod() (Documentation)DELETE /api/v2/users/:user/authentication-methods/:method → deleteAuthenticationMethod() (Documentation)Fixed
Auth0\SDK\API\Authentication with manually assigned client_id or client_secret parameters could have those values overwritten by the SDK's assigned configuration. #705Changed
php-http/discovery dependency with psr-discovery/all.php-http/httplug dependency with psr-discovery/all.ergebnis/composer-normalize as it now runs in CI.firebase/php-jwt as it was replaced by an in-library generator.hyperf/event with symfony/event-dispatcher.laravel/pint with friendsofphp/php-cs-fixer.nyholm/psr7 with psr-mock/http-factory-implementation.php-http/mock-client with psr-mock/http-client-implementation.vimeo/psalm to 5.8.phpstan/phpstan to 1.10.rector/rector to 0.15.Thanks to our contributors for this release: knash94
Fixed
params as array under some conditions #670 (evansims)getItem() call in Auth0\SDK\Token\Verifier::getKeySet() #669 (pkivits-litebit)Fixed
Fixed
Changed
Fixed
Note: Previously in some circumstances, cookie secrets were not always being required in strategies where they should have been required. This has been resolved as part of the fixes in this release. If you are suddenly prompted to configure a cookie secret in an app that doesn't use sessions/cookies, please ensure you are using the correct strategy: https://github.com/auth0/auth0-PHP/tree/8.3.1#configuration-strategies
Added
Changed
samesite property #645 (evansims)getRequestParameter() filter to use FILTER_SANITIZE_FULL_SPECIAL_CHARS and allow passing extra filter options #642 (evansims)login() for transient cookies, and clear() #641 (evansims)How can I help you explore Laravel packages today?