Trouble getting something back with Jumbojett\OpenIDConnectClient

Viewed 11

I am using Jumbojett\OpenIDConnectClient to work with the Danish MitID. I get the authentication form, but afterredirect, I just get this error: Fatal error: Uncaught Jumbojett\OpenIDConnectClientException: The communication to retrieve user data has failed with status code 400 in ...

Here is my code.

ini_set('session.cookie_samesite', 'None');
session_start();

require('/path/to/vendor/jumbojett/autoload.php');

use Jumbojett\OpenIDConnectClient;

$providerurl = '##myProviderUrl.io##';
$clientID = '##MyCllientId##';
$secret = '##MySecret##';

$redirecturl = "the RealRedirectURL";

$oidc = new OpenIDConnectClient($providerurl, $clientID, $secret);                              
    
$oidc->authenticate();
$oidc->requestUserInfo('email');

$session = array();
foreach($oidc as $key=> $value) {
    if(is_array($value)){
            $v = implode(', ', $value);
    }else{
            $v = $value;
    }
    $session[$key] = $v;
}

$_SESSION['attributes'] = $session;
print_r($_SESSION);

I have googled a lot and tried many different things but nothing works.

0 Answers
Related