Download the PHP package happyr/auth0-bundle without Composer
On this page you can find all versions of the php package happyr/auth0-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package auth0-bundle
Auth0 integration with Symfony
Integrate the new authentication system from Symfony 5.2 with Auth0.
Installation
Install with Composer:
Enable the bundle in bundles.php
Add your credentials and basic settings.
You are now up and running and can use services Auth0\SDK\Auth0
, Auth0\SDK\API\Authentication
,
Auth0\SDK\API\Management
and Auth0\SDK\Configuration\SdkConfiguration
.
If you want to integrate with the authentication system there are a bit more configuration you may do.
Authentication
Start by telling Symfony what entrypoint we use and add auth0.authenticator
as
"custom authenticator". This will make Symfony aware of the Auth0Bundle and how to
use it.
Next we need to configure the behavior of the bundle.
The failure_path
and default_target_path
will use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationFailureHandler
and Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler
to handle redirects.
You may use your own handlers by specifying the service ids:
Custom user provider
If you want to use a custom UserProvider that fetches a user with more data than
just the Auth0 id, then you may create a service that implement Happyr\Auth0Bundle\Security\Auth0UserProviderInterface
.
Then configure the bundle to use that service:
Troubleshooting
Make sure you have csrf_protection enabled.
Example configuration
Below is an example configuration. We use the Psr6Store
to store all data in Redis
and the session key in cookies. We also define to use the MemoryStore
when testing.
All versions of auth0-bundle with dependencies
auth0/auth0-php Version ^8.0.0
psr/cache Version ^1.0 || ^2.0 || ^3.0
psr/log Version ^1.0
symfony/config Version ^5.2
symfony/framework-bundle Version ^5.2
symfony/security-bundle Version ^5.3.3
symfony/security-core Version ^5.3