def _verify_google_id_token(request):
if 'google_id_token' not in request.POST:
raise crypt.AppIdentityError("google_id_token missing.")
token = request.POST.get('google_id_token', None)
idinfo = client.verify_id_token(token, django_settings.GOOGLE_CLIENT_ID)
if idinfo['iss'] not in ['accounts.google.com', 'https://accounts.google.com']:
raise crypt.AppIdentityError("Invalid issuer.")
return token, idinfo
评论列表
文章目录