Hi, just going crazy following this tutorial.
https://auth0.com/docs/quickstart/backend/php/01-authorization#integrating-your-php-backend-api
To cut a long story short, instantiating the SDK is not working for me. It throws an error 500. So I wrapped the statement in a try… catch, like this, to see what the error was…
try {
$auth0 = new \Auth0\SDK\Auth0([
'domain' => $_ENV['AUTH0_DOMAIN'],
'clientId' => $_ENV['AUTH0_CLIENT_ID'],
'clientSecret' => $_ENV['AUTH0_CLIENT_SECRET'],
'audience' => $_ENV['AUTH0_AUDIENCE']
]);
} catch (Exception $e) {
exit($e->getMessage());
}
it turns out that the audience parameter is not correct, all other parameters are correct. This is the error message that I captured.
Validation of “audience” was unsuccessful
I’ve been careful to populate the .env file with the information provided in the Auth0 configuration screens correctly. The audience should be the easiest of all, it even appears in your API list, with the copy button & all!
Anybody else has encountered this problem?
All I need is for my PHP code to validate that the Bearer token that it receives in the http request header is a good one. But can’t get past the first step using the Auth0 SDK.
Any help will be appreciated!!!