Trying to add just login to single php file (index.php) application. When going to my application’s URL, it successfully redirects to the Auth0 login page. When I enter the creds of the user I created and click the Continue button, it seems to just reload the Auth0 login page. If I enter the wrong creds, I get an error so at least that’s working. I have the Callback URL set to my application’s URL in my application settings. I also have it set (dynamically) in my code:
<?php
declare(strict_types=1);
require('vendor/autoload.php');
use Auth0\SDK\Auth0;
use Auth0\SDK\Configuration\SdkConfiguration;
$configuration = new SdkConfiguration(
domain: 'dev-uurxjrbjj14phofp.us.auth0.com',
clientId: '[OMMITED]',
clientSecret: '[OMMITED]',
redirectUri: 'https://' . $_SERVER['HTTP_HOST'] . '/',
cookieSecret: '[OMMITED]'
);
$sdk = new Auth0($configuration);
//require('router.php');
$session = $sdk->getCredentials();
$authenticated = $session !== null;
if(!$authenticated) {
header(sprintf('Location: %s', $sdk->login()));
}
// Run index.php if authenticated...
?>
I looked through the documentation, searched this forum, Googled and still can’t figure why it’s not returning to my application’s URL after logging in.
- Gavin