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

尝试在本地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

图片转代码服务由CSDN问答提供 功能建议

我有一个功能完善的Go应用程序,我已经在本地运行了几个月。 使用Google Cloud进行设置,对运行中的域进行了测试,一切正常。

回想一下我的本地计算机,我想运行本地Google AppEngine服务器(而不是直接运行我的Go应用)。 它可以运行,但是我试图在app.yaml中使用“ login:required”参数,并且我在localhost:8080看到登录表单,但是无论我输入什么电子邮件,它都会因503错误而超时。 / p>

我的app.yaml:

 应用程序:myapp-dev 
env:flex 
runtime:go 
api_version:go1 
 
handlers  :
-网址:/ 
脚本:_go_app 
登录名:必需
   
 
 

我用来运行本地应用的命令: \ n

  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.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题