-
Notifications
You must be signed in to change notification settings - Fork 63
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
$provider->getResourceOwner error #12
Comments
Ill check it today. Sorry for some delays.
… Am 13.07.2020 um 13:08 schrieb Filipe Sá ***@***.***>:
Hello,
When using this line of code:
$user = $provider->getResourceOwner($token);
I'm getting the following error:
Fatal error: Uncaught TypeError: Argument 1 passed to League\OAuth2\Client\Provider\Apple::createResourceOwner() must be of the type array, null given, called in /var/www/vhosts/fitben.site/vendor/league/oauth2-client/src/Provider/AbstractProvider.php on line 769 and defined in /var/www/vhosts/fitben.site/vendor/patrickbussmann/oauth2-apple/src/Provider/Apple.php:191 Stack trace: #0 /var/www/vhosts/fitben.site/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(769): League\OAuth2\Client\Provider\Apple->createResourceOwner(NULL, Object(League\OAuth2\Client\Token\AppleAccessToken)) #1 /var/www/vhosts/fitben.site/httpdocs/paginas/refresh/apple-callback.php(39): League\OAuth2\Client\Provider\AbstractProvider->getResourceOwner(Object(League\OAuth2\Client\Token\AppleAccessToken)) #2 {main} thrown in /var/www/vhosts/fitben.site/vendor/patrickbussmann/oauth2-apple/src/Provider/Apple.php on line 191
I used this git on another project and everything works fine, can this be an issue with a recent update to you package?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
You call this:
So it will use the league/oauth2-client library. This will fetch the details from your oauth2 provider (its Apple).
So When we check the code here: https://github.com/patrickbussmann/oauth2-apple/blob/master/src/Provider/Apple.php#L115 Can you please post the link location href (browser url) when you get this error? But I also added a test case and a fix for it in the new version. Your $_POST['user'] seems to be an empty string or the $_GET['user'] is an empty string. |
@welove please test this script, too.
It should show you "invalid_grant". I had the same issue now. |
Hello, I tested the script and it didn't catch any exception. One curious thing, is that I get the Fatal Error I mentioned in the first comment, only when I Sign In for the first time! If my Apple ID already authorized the app, the login works fine. Only problem is that it's only possible to get the users First and Last name on the first authorization. |
Hmm confusing. I release the new version soon so you can try with dev-master. |
I just updated the new script you've released, and now I don't get any error. But I'm not getting the user name: $pnome = $user->getFirstName(); this stays empty :( What is stranger is that I have your script on another server and everything works fine. |
No it cant run fine. Then try again please 👍 |
Already did that. On the dialog prompt it asks me to authorize the Name and Email like its supposed to. But $user->getFirstName(); still returns empty. |
After mailing a bit we found the issue. So when someone else has this issue please check if the $_POST is manipulated somewhere. 😉 |
Hello,
When using this line of code:
$user = $provider->getResourceOwner($token);
I'm getting the following error:
Fatal error: Uncaught TypeError: Argument 1 passed to League\OAuth2\Client\Provider\Apple::createResourceOwner() must be of the type array, null given, called in /var/www/vhosts/fitben.site/vendor/league/oauth2-client/src/Provider/AbstractProvider.php on line 769 and defined in /var/www/vhosts/fitben.site/vendor/patrickbussmann/oauth2-apple/src/Provider/Apple.php:191 Stack trace: #0 /var/www/vhosts/fitben.site/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(769): League\OAuth2\Client\Provider\Apple->createResourceOwner(NULL, Object(League\OAuth2\Client\Token\AppleAccessToken)) #1 /var/www/vhosts/fitben.site/httpdocs/paginas/refresh/apple-callback.php(39): League\OAuth2\Client\Provider\AbstractProvider->getResourceOwner(Object(League\OAuth2\Client\Token\AppleAccessToken)) #2 {main} thrown in /var/www/vhosts/fitben.site/vendor/patrickbussmann/oauth2-apple/src/Provider/Apple.php on line 191
I used this git on another project and everything works fine, can this be an issue with a recent update to you package?
The text was updated successfully, but these errors were encountered: