-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Google_Client::fetchAccessTokenWithAuthCode fails to fetch the token but does not throw. #1700
Comments
It's a bit hard to tell what the application flow is from what you've provided. Are you requesting access and immediately fetching the user data, or is there a delay? Is the Can you provide more of the setup, specifically related to how you're configuring the oauth access requests? |
Well the setup is done with a nette DI container builder like this (I hope it is obvious how it ultimately is done):
EDIT:
and
EDIT END Yes, the $code is coming directly from the auth grant flow, after the user should have authorized our app the access to the provided scopes (just email and profile really) and is redirected to the configured redirect uri.
But we just sometimes get the exception on the second line. |
Oh and "version": "v2.2.2" |
And here is how we use the client to redirect the user to the gogle auth server:
The $state there is something we generate and hash, and on the redirect uri endpoint this is already verified before we are fetching the access token from the $code. |
There were some minor bug fixes to auth in v2.2.3 (re: new auth URLs), v2.2.4 (re: documentation for cached auth tokens), and v2.4.1 (re: removing duplicated code) but a larger feature update in v2.12.2 (re: allowing the |
@meredithslota Well, wow, this is really an old issue. We have updated the lib about 5 times since. Now we are running v2.12.1 and I don't remember when I have last seen this error. It's definitely not in our 14 day log history now :) I will reopen the issue if i see it ever again, but that seems unlikely at this point. |
Hello,
we have recently deployed google oauth authentication to register/login users to our application.
It works quite well, but sometimes we get the following error:
The code that triggers this error looks like this:
The
$this->client
is an instance ofGoogle_Client
and$this->oauth
is instanceofGoogle_Service_Oauth2
. As I already said it works fine for most cases, but sometimes the exception is thrown. And so I believe the client setup is ok and therefore I'm not including it here. What seems strange to me, is that the error is thrown by theGoogle_Service_Oauth2_Resource_Userinfo::get()
and not byGoogle_Client::fetchAccessTokenWithAuthCode()
.And so I want to ask 2 things:
prompt
with valueconsent
- not sure what it means and not sure if it is there in the cases when everything works fine, since we are not logging anything when it works....The text was updated successfully, but these errors were encountered: