Sean Connolly February 2016

How can I use "login: required" on a Google App Engine app using a custom domain?

I have a Python GAE app on a custom domain. When I add login: required to any handler, the site redirects to the app's appspot.com domain instead of my custom domain. The functionality of the site isn't affected, and all handlers and routes continue to work as expected — just on the appspot.com domain instead.

Example snippet from the app.yaml below. mydomain.com works fine with the custom domain, mydomain.com/test and any other handlers redirect to the appspot.com domain after authentication (myapp.appspot.com/test).

- url: /
  script: main.application

- url: /test
  script: main.application
  login: required

- url: /.*
  script: main.application
  login: required

Is this a configuration issue with how App Engine is handling the domain, or is this an issue with the redirect used by the login: required setting?

Answers


DoIT International February 2016

You need to set Authorized redirect URIs in your Developer Console (under API | Credentials) to your custom domain rather than the default appspot.com. So the requests coming from the custom domain would be 'called-back' to the custom domain as well.

Take a look on the attached screenshot on how this is configured for my application.

[Redirect URI]

Post Status

Asked in February 2016
Viewed 1,358 times
Voted 4
Answered 1 times

Search




Leave an answer