Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python google app engine上google登录身份验证令牌的后端验证问题_Python_Ios_Google App Engine_Google Signin_Pyopenssl - Fatal编程技术网

Python google app engine上google登录身份验证令牌的后端验证问题

Python google app engine上google登录身份验证令牌的后端验证问题,python,ios,google-app-engine,google-signin,pyopenssl,Python,Ios,Google App Engine,Google Signin,Pyopenssl,我正在尝试将Google登录集成到我的iOS应用程序中。我能够在我的应用程序中显示登录按钮,并在成功登录后获得设备身份验证令牌 我的后端在谷歌应用程序引擎上运行。我正在将设备身份验证令牌发送到后端,并尝试使用中的示例代码验证令牌 但是,当后端尝试执行client.verify_id_token来验证令牌时,我遇到了文章末尾显示的错误 日志中的错误如下所示。对Stackoverflow的一些搜索表明,如果启用pyOpenSSL,问题将消失。我该怎么做 还有一个问题可能是这次失败的根本原因。中代码中

我正在尝试将Google登录集成到我的iOS应用程序中。我能够在我的应用程序中显示登录按钮,并在成功登录后获得设备身份验证令牌

我的后端在谷歌应用程序引擎上运行。我正在将设备身份验证令牌发送到后端,并尝试使用中的示例代码验证令牌

但是,当后端尝试执行client.verify_id_token来验证令牌时,我遇到了文章末尾显示的错误

日志中的错误如下所示。对Stackoverflow的一些搜索表明,如果启用pyOpenSSL,问题将消失。我该怎么做

还有一个问题可能是这次失败的根本原因。中代码中的CLIENT_ID和IOS_CLIENT_ID字段需要使用什么值

目前,我正在使用开发者控制台->API和身份验证->凭证->OAuth 2.0客户端ID->iOS客户端下列出的客户端ID for com.apm.smartiothome.chatime。这是正确的吗?另外,我是否需要在开发人员控制台中选中此旁边的复选框

在GAE日志中看到错误


您的客户端正在发送X509证书,App Engine上使用的PyCrypto库不支持该证书。如果本机代码是一个选项,那么如果您运行的是托管虚拟机而不是经典的应用程序引擎,请参阅-但请注意,这是测试版。如果MVM是您的一个选项,那么您可以通过mods将库添加到docker文件中—有点长,甚至不知道MVM是否是一个选项。否则,您必须对IOS应用程序进行编码,以通过x509证书以外的其他方式验证IOS问题,而不是我的字段。谢谢。客户端应该发送什么类型的证书?然后,我可以进行一些搜索,以了解如何让我的iOS应用程序发送所需类型的证书。那么,请告诉我中示例代码中的CLIENT_IF和iOS_CLIENT_ID的值是多少?如果您仅为iOS开发,则CLIENT_ID与iOS_CLIENT_ID相同,请在GoogleService-Info.plist中找到,如前几节所述。谢谢,这非常有用。您还可以告诉我需要什么类型的证书,以便我知道如何让我的iOS应用程序发送它吗?
Encountered unexpected error from ProtoRPC method implementation: NotImplementedError (X509 certs are not supported by the PyCrypto library. Try using PyOpenSSL if native code is an option.)
Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/protorpc-1.0/protorpc/wsgi/service.py", line 181, in protorpc_service_app
    response = method(instance, request)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/endpoints-1.0/endpoints/api_config.py", line 1332, in invoke_remote
    return remote_method(service_instance, request)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/protorpc-1.0/protorpc/remote.py", line 414, in invoke_remote_method
    response = method(service_instance, request)
  File "/base/data/home/apps/s~chatimegae/v1.388848915040088794/apns_server.py", line 274, in registerDevice
    if(self._validateAuthToken(rcvdDeviceAuthToken,rcvdDeviceAuthType,rcvdUserID)):
  File "/base/data/home/apps/s~chatimegae/v1.388848915040088794/apns_server.py", line 181, in _validateAuthToken
    idinfo = client.verify_id_token(rcvdDeviceAuthToken, CLIENT_ID)
  File "/base/data/home/apps/s~chatimegae/v1.388848915040088794/oauth2client/util.py", line 132, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/base/data/home/apps/s~chatimegae/v1.388848915040088794/oauth2client/client.py", line 1012, in verify_id_token
    return crypt.verify_signed_jwt_with_certs(id_token, certs, audience)
  File "/base/data/home/apps/s~chatimegae/v1.388848915040088794/oauth2client/crypt.py", line 338, in verify_signed_jwt_with_certs
    verifier = Verifier.from_string(pem, True)
  File "/base/data/home/apps/s~chatimegae/v1.388848915040088794/oauth2client/crypt.py", line 190, in from_string
    'X509 certs are not supported by the PyCrypto library. '
NotImplementedError: X509 certs are not supported by the PyCrypto library. Try using PyOpenSSL if native code is an option.