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
Error: "mwoauth-oauth-exception" #3
Comments
Hi franbueno, can you tell me where you're getting that error? Backtrace or debug log would be great. |
Sure :) array(1) { [0]=> array(7) { ["file"]=> string(53) "/Applications/MAMP/htdocs/mwoauth-php-master/demo.php" ["line"]=> int(28) ["function"]=> string(8) "initiate" ["class"]=> string(13) "MWOAuthClient" ["object"]=> object(MWOAuthClient)#3 (5) { ["config":"MWOAuthClient":private]=> object(MWOAuthClientConfig)#1 (5) { ["endpointURL"]=> string(57) "https://www.mediawiki.org/w/index.php?title=Special:OAuth" ["canonicalServerUrl"]=> string(25) "https://www.mediawiki.org" ["redirURL"]=> string(45) "https://www.mediawiki.org/view/Special:OAuth?" ["useSSL"]=> bool(true) ["verifySSL"]=> bool(false) } ["consumerToken":"MWOAuthClient":private]=> object(OAuthToken)#2 (2) { ["key"]=> string(32) "b02833d71fe5700c891c531fe041c36c" ["secret"]=> string(40) "f2b6f6ccc47e9f6b298eaa74789897b98dc6a594" } ["extraParams":"MWOAuthClient":private]=> array(0) { } ["callbackUrl":"MWOAuthClient":private]=> string(3) "oob" ["lastNonce":"MWOAuthClient":private]=> string(32) "6ee6e80b91a0e4f58159446292b0c731" } ["type"]=> string(2) "->" ["args"]=> array(0) { } } } |
Hi franbueno, so the first thing that's odd is that it looks like you're running this against mediawiki.org, but that consumer key (b02833d71fe5700c891c531fe041c36c) isn't registered there. Did you import that key/secret from somewhere else? |
You were right. I created a new one: $consumerKey = '8c8acd2db5456006532759bd44777a5d'; Now i get "'Invalid JWT signature from /identify.'". Backtrace: array(1) { [0]=> array(7) { ["file"]=> string(53) "/Applications/MAMP/htdocs/mwoauth-php-master/demo.php" ["line"]=> int(28) ["function"]=> string(8) "initiate" ["class"]=> string(13) "MWOAuthClient" ["object"]=> object(MWOAuthClient)#3 (5) { ["config":"MWOAuthClient":private]=> object(MWOAuthClientConfig)#1 (5) { ["endpointURL"]=> string(57) "https://www.mediawiki.org/w/index.php?title=Special:OAuth" ["canonicalServerUrl"]=> string(25) "https://www.mediawiki.org" ["redirURL"]=> string(45) "https://www.mediawiki.org/view/Special:OAuth?" ["useSSL"]=> bool(true) ["verifySSL"]=> bool(false) } ["consumerToken":"MWOAuthClient":private]=> object(OAuthToken)#2 (2) { ["key"]=> string(32) "8c8acd2db5456006532759bd44777a5d" ["secret"]=> string(40) "cc9a08d3aed8b39dc57474700590bddca630b466" } ["extraParams":"MWOAuthClient":private]=> array(0) { } ["callbackUrl":"MWOAuthClient":private]=> string(3) "oob" ["lastNonce":"MWOAuthClient":private]=> string(32) "23df5b8987f1273e6669dff729ae4561" } ["type"]=> string(2) "->" ["args"]=> array(0) { } } } Point your browser to: https://www.mediawiki.org/view/Special:OAuth?oauth_token=3bb5d95fd78cf2f5f150e2377313f0a4&oauth_consumer_key=8c8acd2db5456006532759bd44777a5d Enter the verification code: |
Could you check it? :) |
Hi franbueno, To clarify, when you're testing this using demo.php, you're visiting the mediawiki.org url, logging in as Jamonderata (<- this is the only user who can use that consumer before it's approved), approving the application, then cutting-and-pasting the authorization code back into the demo.php client, correct? In the output you have here, you didn't put the code in, so I wanted to make sure you did that. From the backtrace, it's passing '{"error":"mwoau...', 'cc9a08d3aed8b39...' to decodeJWT, so you're getting an error message back from the call to /identify instead of an actual JWT (demo.php should probably be updated to detect that). |
Hey Stype, i really dont understand how it works. Did you mind if we talk in Skype (username: jamonderata). I only need some minutes :) |
Hi Chris,
Im always getting this issue:
error: "mwoauth-oauth-exception"
This is my consumer and secret keys:
$consumerKey = 'b02833d71fe5700c891c531fe041c36c';
$consumerSecret = 'f2b6f6ccc47e9f6b298eaa74789897b98dc6a594';
$config = new MWOAuthClientConfig(
'https://www.mediawiki.org/w/index.php?title=Special:OAuth', // url to use
true, // do we use SSL? (we should probably detect that from the url)
false // do we validate the SSL certificate? Always use 'true' in production.
);
$config->canonicalServerUrl = 'https://www.mediawiki.org';
$config->redirURL = 'https://www.mediawiki.org/view/Special:OAuth?';
Can you help me? :)
The text was updated successfully, but these errors were encountered: