dongzinen1061 2017-11-11 00:51
浏览 89
已采纳

尝试在本地Google AppEngine服务器上登录时出现503错误

I have a functional Go app which I've been running locally for months. Got setup with Google Cloud, did a test run to a live domain, everything works.

Looking back at my local machine, I want to run a local Google AppEngine server (instead of running my Go app directly). It runs, however I'm trying to use the "login: required" parameter in app.yaml, and I see the login form at localhost:8080, however no matter what email I input, it keeps timing out with 503 errors.

My app.yaml:

application: myapp-dev
env: flex
runtime: go
api_version: go1

handlers:
- url: /
  script: _go_app
  login: required

Command I use to run the local app:

dev_appserver.py app.yaml
  • 写回答

1条回答 默认 最新

  • douxuan1284 2018-02-04 18:48
    关注

    Flexible environment doesn't support 'login' features via app.yaml (external to whatever regular login you'd do in your app).

    Standard environment app.yaml doc DOES list 'login' features: https://cloud.google.com/appengine/docs/standard/go/config/appref

    Flexible environment app.yaml doc DOES NOT list 'login' features: https://cloud.google.com/appengine/docs/flexible/go/configuring-your-app-with-app-yaml

    But more specifically, a page talking about upgrading from Standard-to-Flex, mentions that the login handlers for flex have been deprecated:

    https://cloud.google.com/appengine/docs/flexible/go/upgrading

    The login setting under handlers is now deprecated for the App Engine flexible environment. You should follow the guidance for User service migration.

    So basically, with flex environment, there is no project-wide login controls possible outside of your app. You have to let the app initialize and then do normal authentication/authorization.

    For my own project, I wanted a quick app-wide level of security so I could provide guest accounts and have them see what a public not-logged-in view of my app would be. Yes I can do the same within my app, I just wanted to save some work.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?