Set expiration time for the access token(COMPOSER PHP)

Hi @bhavith.chandra, you need to configure audience as an array rather than a string, as it accepts multiple potential identifiers for verification.

use Auth0\SDK\Auth0;
use Auth0\SDK\Configuration\SdkConfiguration;

$configuration = new SdkConfiguration(
  domain: '...',
  clientId: '...',
  clientSecret: '...',
  cookieSecret: '...',
  redirectUri: '...',
  audience': ['https://sdfhv/api'],
);

$auth0 = new Auth0($configuration);

I recommend configuring with the SdkConfiguration class, as it provides helpful type hinting that your IDE can surface for you for things like this.

For reference, here’s the constructor definition for that class, which lists all the available options and their types: auth0-PHP/SdkConfiguration.php at main · auth0/auth0-PHP · GitHub

1 Like