部署时ClientId未更新 - 用户注入null [英] ClientId not updated when deploying - User injected null

查看:155
本文介绍了部署时ClientId未更新 - 用户注入null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建并配置了所有clientId(WEB,Android和iOS),但是当我在本地运行服务器或者部署到App Engine PROD,我总是遇到以下问题:

 警告:getCurrentUser: clientId 292824132082.apps.googleusercontent.com不允许

此clientId 292824132082.apps .googleusercontent.com 是首次创建Cloud EndPoint时自动生成的缺省值,当您配置自己的clientIds并生成Cloud EndPoint客户端库时,它应该被覆盖。我可以在我的 noteendpoint-v2.api (我的API被称为 NoteEndPoint )中看到clientIds里面是更新的,但我不能让他们发布到本地或PROD。



任何线索我做错了什么或我忘了?



pre> @Api(name =myApi,
version =v1,
...
clientIds = {Constants.API_EXPLORER_CLIENT_ID,yourOtherIds}

其中Constants.API_EXPLORER_CLIENT_ID为

  public static final String API_EXPLORER_CLIENT_ID = com.google.api.server.spi.Constant.API_EXPLORER_CLIENT_ID; 


I am creating a project with App Engine and Cloud EndPoints using OAuth 2.0.

I created and configured all the clientIds (WEB, Android and iOS), but when both I run the server in local or I deploy to App Engine PROD, I always get the following problem:

WARNING: getCurrentUser: clientId 292824132082.apps.googleusercontent.com not allowed

This clientId 292824132082.apps.googleusercontent.com is the default one generated automatically when you create the Cloud EndPoints the first time, and it is supposed to be overwritten when you configure you own clientIds and generate the Cloud EndPoint Client Libraries. I can see in my noteendpoint-v2.api (My API is called NoteEndPoint) that the clientIds inside are update, but I cannot get they are published to local or PROD.

Any clue about what I am doing wrong or I am forgetting?

解决方案

If you are testing your endpoint in API Explorer you need to add it's ID as one of the accepted ones:

 @Api(name = "myApi",
     version = "v1",
     ...
     clientIds = {Constants.API_EXPLORER_CLIENT_ID, yourOtherIds}

Where Constants.API_EXPLORER_CLIENT_ID is

     public static final String API_EXPLORER_CLIENT_ID = com.google.api.server.spi.Constant.API_EXPLORER_CLIENT_ID;

这篇关于部署时ClientId未更新 - 用户注入null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆