Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get the same error. How do you solve it? #49

Open
Khairulazwan opened this issue Aug 23, 2022 · 0 comments
Open

I get the same error. How do you solve it? #49

Khairulazwan opened this issue Aug 23, 2022 · 0 comments

Comments

@Khairulazwan
Copy link

@mattrjk @kschroeder

`<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
require_once DIR . '/vendor/autoload.php';

session_start();

$config = [
'authentication' => [
'ad' => [
'client_id' => '----------------',
'client_secret' => '2F3-----------------',
'redirect_url' => 'https://----------------.azurewebsites.net/login/',
'enabled' => '1',
'directory' => '----------------d0e5'
]
]
];

$request = new \Zend\Http\PhpEnvironment\Request();

$ad = new \Magium\ActiveDirectory\ActiveDirectory(
new \Magium\Configuration\Config\Repository\ArrayConfigurationRepository($config),
Zend\Psr7Bridge\Psr7ServerRequest::fromZend(new \Zend\Http\PhpEnvironment\Request())
);

$entity = $ad->authenticate();
echo $entity->getName() . '
';
//echo $entity->getOid() . '
';
echo $entity->getPreferredUsername() . '
';
?>`

Despite having defined redirect_url is am still getting the below error;

Fatal error: Uncaught League\OAuth2\Client\Provider\Exception\IdentityProviderException: invalid_client in D:\home\site\wwwroot\login\vendor\league\oauth2-client\src\Provider\GenericProvider.php:216 Stack trace: #0 D:\home\site\wwwroot\login\vendor\league\oauth2-client\src\Provider\AbstractProvider.php(644): League\OAuth2\Client\Provider\GenericProvider->checkResponse(Object(GuzzleHttp\Psr7\Response), Array) #1 D:\home\site\wwwroot\login\vendor\league\oauth2-client\src\Provider\AbstractProvider.php(560): League\OAuth2\Client\Provider\AbstractProvider->getResponse(Object(GuzzleHttp\Psr7\Request)) #2 D:\home\site\wwwroot\login\src\Delegates\Receive.php(81): League\OAuth2\Client\Provider\AbstractProvider->getAccessToken(Object(League\OAuth2\Client\Grant\AuthorizationCode), Array) #3 D:\home\site\wwwroot\login\src\ActiveDirectory.php(179): Magium\ActiveDirectory\Delegates\Receive->execute() #4 D:\home\site\wwwroot\login\index.php(28): Magium\ActiveDirectory\ActiveDirectory->authenticate() #5 {main} thrown in D:\home\site\wwwroot\login\vendor\league\oauth2-client\src\Provider\GenericProvider.php on line 216

Originally posted by @dewhurstwill in #22 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant