What user is provided by App Engine's devserver when requesting the user from UserService, OAuthService or Cloud Endpoints Injection?
What user is provided by App Engine Devserver
446 views Asked by Aaron Roller At
2
There are 2 answers
0

They return the user object corresponds to the currently logged in user.
I there is no user logged in, they will return null
You can redirect the user to login page by redirecting to url retured by UserService.createLoginUrl()
This works same in production and dev server. only difference is dev server doesn't validate the user credentials. It asks for email only, no passsword required.
Deploy this Api class in an endpoints project:
Summary
Details
No authentication, no OAuth Authorization
API Explorer OAuth authorized (default credentials)
Devserver login via /_ah/login (default credentials)
Returning null from endpoints results in http status = 204. Null is the correct endpoints behavior per the docs.
OAuthService docs explain returning user zero is the expected behavior.
Two accounts returned:
These tests were run using appengine-maven-plugin:1.9.21:devserver
Conclusion
I answered my own question, but I will ask why does it need to be this confusing?