Function User.getUserId() in Cloud endpoint api returns null for a user object that is not null

前端 未结 2 1076
滥情空心
滥情空心 2021-01-02 02:45

I have a problem with getting the userid for a cloud endpoint method. I have used oauth2 authentication in my android client and passed the credentials to my service. The be

2条回答
  •  臣服心动
    2021-01-02 03:11

    You're correct that issue 8848 is the same cause. The underlying issue is language-agnostic and affects both runtimes. At the moment you shouldn't expect the user ID field populated in a User object passed in via method argument in Endpoints.

    A super suboptimal workaround is to persist the User object to the datastore and read it back. The re-read object will have the user ID included.

提交回复
热议问题