AppEngine Firebase example broken
triage mepriority: p2type: bugsamples
The problem is in using Firebase for handling user login in [this tutorial step](https://docs.cloud.google.com/appengine/docs/standard/python3/building-app/authenticating-users), which walks the user in creating code like in [this GitHub directory](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/main/appengine/standard_python3/building-an-app/building-an-app-3) when completed.
To reproduce the problem:
1. Create firebase project
1. Create firebase app
1. In Authentication -> Sign-in method, set up Google and Email auth
1. In Authentication -> Settings, add 127.0.0.1 as authorized domain
1. In Project Settings -> General, in SDK setup and configuration, copy js for app config
1. Set up the codelab code and launch the site:
<pre><code>
$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples
$ cd python-docs-samples/appengine/standard_python3/building-an-app/building-an-app-3
## Update TODO in templates/index.html with app config js from above
$ python3.13 -m venv .venv
$ source .venv/bin/activate
$ pip install -r requirements.txt
$ python main.py
</code></pre>
The site can be viewed at http://127.0.0.1:8080/
Signing in with either of the two methods fails:
- Sign in with Google: OAuth flow completes but user is not signed in when redirect back to site (user is not present in database)
- Sign in with email: works first time, but cannot sign in again (user is present in database)
0 条评论