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

Internal error: Required parameter not passed: "code" #6

Open
torgeirl opened this issue Dec 22, 2017 · 0 comments
Open

Internal error: Required parameter not passed: "code" #6

torgeirl opened this issue Dec 22, 2017 · 0 comments

Comments

@torgeirl
Copy link

Login works but on redirect I get Notice: Undefined Index and Required parameter not passed: "code" when I try to use this extension. The OAuth2 provider I'm using (Dataporten; documentation) responds with the expected $response['user'][...] key so that shouldn't be a problem (issue #3).

In the start I thought it had something to do with PHP7 incompatibility, but I get the same result using PHP5.6, PHP7.0 and PHP7.1.

Setup
MediaWiki 1.30.0
PHP 7.1.12 (using php-fpm for Nginx)
PostgreSQL 9.5.10
ICU 55.1

Full errors (userid and state replaced with X's)
Notice: Undefined Index: code in /var/www/wiki/extensions/MW-OAuth2Client/SpecialOAuth2Client.php on line 98

/index.php/Spesial:OAuth2Client/callback?code=XXXXXXXX-XXXX-XXXX&state=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX BadMethodCallException from line 35 of /var/www/wiki/extensions/MW-OAuth2Client/vendors/oauth2-client/src/Tool/RequiredParameterTrait.php: Required parameter not passed: "code"

Backtrace:
#0 /var/www/wiki/extensions/MW-OAuth2Client/vendors/oauth2-client/src/Tool/RequiredParameterTrait.php(53): League\OAuth2\Client\Grant\AbstractGrant->checkRequiredParameter(string, array)
#1 /var/www/wiki/extensions/MW-OAuth2Client/vendors/oauth2-client/src/Grant/AbstractGrant.php(76): League\OAuth2\Client\Grant\AbstractGrant->checkRequiredParameters(array, array)
#2 /var/www/wiki/extensions/MW-OAuth2Client/vendors/oauth2-client/src/Provider/AbstractProvider.php(563): League\OAuth2\Client\Grant\AbstractGrant->prepareRequestParameters(array, array)
#3 /var/www/wiki/extensions/MW-OAuth2Client/SpecialOAuth2Client.php(98): League\OAuth2\Client\Provider\AbstractProvider->getAccessToken(League\OAuth2\Client\Grant\AuthorizationCode, array)
#4 /var/www/wiki/extensions/MW-OAuth2Client/SpecialOAuth2Client.php(65): SpecialOAuth2Client->_handleCallback()
#5 /var/www/wiki/includes/specialpage/SpecialPage.php(522): SpecialOAuth2Client->execute(string)
#6 /var/www/wiki/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(string)
#7 /var/www/wiki/includes/MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
#8 /var/www/wiki/includes/MediaWiki.php(851): MediaWiki->performRequest()
#9 /var/www/wiki/includes/MediaWiki.php(523): MediaWiki->main()
#10 /var/www/wiki/index.php(43): MediaWiki->run()
#11 {main}
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