http://localhost:3000/callback
.http://localhost:3000
.http://localhost:3000
.index.php
, and copy in the code from the interactive
panel to the right under the index.php tab.For the SDK to function properly, you must set the following properties in the Auth0 SDK during initialization:domain
: The domain of your Auth0 tenant. Generally, you can find this in the Auth0 Dashboard
under your Application’s Settings in the Domain field. If you are using a custom domain, you should set this to the
value of your custom domain instead.clientId
: The ID of the Auth0 Application you set up earlier in this quickstart. You can find
this in the Auth0 Dashboard under your Application’s Settings in the Client ID field.clientSecret
: The secret of the Auth0 Application you set up earlier in this quickstart. You can
find this in the Auth0 Dashboard under your Application’s Settings in the Client Secret field.redirectUri
: The URL in your application that you would like Auth0 to redirect users to after
they have authenticated. This corresponds to the callback URL you set up earlier in this quickstart. You can
also find this value in the Auth0 Dashboard under your Application’s Settings in the Callback URLs field. Make
sure what you enter in your code matches what you set up earlier or your users will see an error.cookieSecret
: A long secret value used to encrypt the session cookie. You can generate a
suitable string by running openssl rand -hex 32
in your terminal.router.php
to define our routes, and copy in the code
from the interactive panel to the right.login()
method to create a login button that redirects
users to the Auth0 Universal Login page. After a user successfully authenticates, they will be redirected to the
callback URL you set up earlier in this quickstart.Create a new file in your application called login.php
to handle logging process, and copy in the
code from the interactive panel to the right, which contains the logic needed for login.redirectUri
you used
to configure the SDK.logout()
method. When users log out, they will be redirected to your Auth0 logout endpoint, which
will then immediately redirect them to the logout URL you set up earlier in this quickstart.Create a new file in your application called logout.php
for handling the process, and copy in the
code from the interactive panel, which contains the logic needed for logout. Then, update your
index.php
file to include the logout button.getCredentials()
method. Review the
profile.php
code in the interactive panel to see an example of how to use it.Because the method contains sensitive information related to the user’s identity, its availability depends on the
user’s authentication status. To prevent render errors, you should always check if the
getCredentials()
method returns an object
or null
to determine whether
Auth0 has authenticated the user before your application consumes the results.nickname
or any other user property correctly after you have logged
in.