-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 Sign in problem #826
Comments
|
I only use the |
@voutilad I noticed that the Google+ Auth code currently has the following scopes:
Maybe all that needs to be done is remove the scope, |
@ami-fairfly any progress on this? |
@Gitfred we ended up just following this guide and implementing it ourselves, and had an easier time integratng it to our existing auth solution https://developers.google.com/identity/sign-in/android/offline-access |
@ami-fairfly you can share your implementation?, we need really solve this issue. I try with android and web to get token_id and send to server and can't solve. and try it with documentation sample google+ sign in button and doesn't works |
Hi @liberathor , We don't use this code anymore but this is the gist of it. Hope it helps! import datetime
import logging
import pytz
from oauth2client import crypt
from django.conf import settings
from oauth2client import client as oauth_client
class GoogleAuthBridge:
def __init__(self, uses_new_google_client_id):
self.uses_new_google_client_id = uses_new_google_client_id
def validate_token(self, token):
try:
client_id_for_verification = settings.GOOGLE_SERVER_CLIENT_ID if self.uses_new_google_client_id else settings.GOOGLE_SERVICE_ACCOUNT_CLIENT_ID
idinfo = oauth_client.verify_id_token(token, client_id_for_verification)
# If multiple clients access the backend server:
if idinfo['aud'] not in [settings.GOOGLE_ANDROID_CLIENT_ID, settings.GOOGLE_IOS_CLIENT_ID,
settings.GOOGLE_SERVER_CLIENT_ID, settings.GOOGLE_WEB_CLIENT_ID,
settings.GOOGLE_SERVICE_ACCOUNT_CLIENT_ID]:
raise crypt.AppIdentityError("Unrecognized client.")
if idinfo['iss'] not in ['accounts.google.com', 'https://accounts.google.com']:
raise crypt.AppIdentityError("Wrong issuer.")
except crypt.AppIdentityError:
# Invalid token
return None, None
# Convert from google's timestamp to our "seconds till expiration" format
expiration_timestamp = int(idinfo['exp'])
now = datetime.datetime.now(tz=pytz.UTC)
expiration_time = datetime.datetime.fromtimestamp(expiration_timestamp).replace(tzinfo=pytz.UTC)
seconds_till_expiration = expiration_time - now
return token, seconds_till_expiration.seconds
` |
Ah, good old apathy. Too bad GooglePlusAuth still doesn't work. |
When trying to sign in via Google and a mobile app (used this example http://psa.matiasaguirre.net/docs/use_cases.html#signup-by-oauth-access-token) I'm getting a 403 Forbidden error with the following response:
from googling around I saw that the common issue is having Google+ API disabled, but for us it was already enabled due to previous use of the API in another internal project.
What I tried:
Our settings:
Facebook works perfectly
Would love any assistance!
The text was updated successfully, but these errors were encountered: