1

我在關注GAE上的用戶身份驗證教程this,Python中的端點v2。 我完全使用他們的代碼(只粘貼在我的應用程序ID中)。 通過PyCharm在本地運行代碼,它不喜歡需要字典的「發行者」類型:TypeError:發行者類型不匹配。GAE端點firebase:身份驗證用戶TypeError:發佈者類型不匹配<type 'dict'>

是否與IDE集成尚未支持有關?我忽略了什麼?

在全:

ERROR 2017-06-05 15:23:19,417 wsgi.py:263] 
Traceback (most recent call last): 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 240, in Handle 
    handler = _config_handle.add_wsgi_middleware(self._LoadHandler()) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 299, in _LoadHandler 
    handler, path, err = LoadObject(self._handler) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\google\appengine\runtime\wsgi.py", line 85, in LoadObject 
    obj = __import__(path[0]) 
    File "C:\Users(...)\web app\goal.py", line 103, in <module> 
    issuers=[firebase_issuer]) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\protorpc-1.0\protorpc\util.py", line 173, in positional_wrapper 
    return wrapped(*args, **kwargs) 
    File "C:\Users\(...)\web app\lib\endpoints\api_config.py", line 976, in api 
    api_key_required=api_key_required, base_path=base_path) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\protorpc-1.0\protorpc\util.py", line 173, in positional_wrapper 
    return wrapped(*args, **kwargs) 
    File "C:\Users\(...)\web app\lib\endpoints\api_config.py", line 469, in __init__ 
    base_path=base_path) 
    File "C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\platform\google_appengine\lib\protorpc-1.0\protorpc\util.py", line 173, in positional_wrapper 
    return wrapped(*args, **kwargs) 
    File "C:\Users\(...)\web app\lib\endpoints\api_config.py", line 550, in __init__ 
    _CheckType(issuers, dict, 'issuers') 
    File "C:\Users\(...)\web app\lib\endpoints\api_config.py", line 195, in _CheckType 
    raise TypeError('%s type doesn\'t match %s.' % (name, check_type)) 
TypeError: issuers type doesn't match <type 'dict'>. 

回答

2

道歉不正確的文件。你確實需要傳遞一個字典。所以請嘗試issuers={'firebase': firebase_issuer}