Google app engine 使用Google云端点时的身份验证问题
我目前正在使用安卓studio开发安卓应用程序,并使用安卓studio开发谷歌云端点模块。因此,我尝试通过Firebase身份验证添加用户身份验证,以便为我的用户提供来自不同用户的登录选项。但是,每当我尝试将身份验证代码添加到端点类中的API时。APIssuer和APIssuerAudience始终未解决。我已经尝试了所有的方法,但我无法修复这个问题,所以我假设我没有做或做了一些错误的事情来影响代码的这一部分Google app engine 使用Google云端点时的身份验证问题,google-app-engine,android-studio,firebase-authentication,google-cloud-endpoints,Google App Engine,Android Studio,Firebase Authentication,Google Cloud Endpoints,我目前正在使用安卓studio开发安卓应用程序,并使用安卓studio开发谷歌云端点模块。因此,我尝试通过Firebase身份验证添加用户身份验证,以便为我的用户提供来自不同用户的登录选项。但是,每当我尝试将身份验证代码添加到端点类中的API时。APIssuer和APIssuerAudience始终未解决。我已经尝试了所有的方法,但我无法修复这个问题,所以我假设我没有做或做了一些错误的事情来影响代码的这一部分 package com.example.Kendrickod.myapplicatio
package com.example.Kendrickod.myapplication.backend;
import com.example.Kendrickod.myapplication.backend.domain.Profile;
import com.google.api.server.spi.auth.EspAuthenticator;
import com.google.api.server.spi.config.Api;
import com.google.api.server.spi.config.ApiMethod;
import com.google.api.server.spi.config.ApiNamespace;
import com.google.api.server.spi.config.Named;
/**
* Defines event APIs.
*/
/** An endpoint class we are exposing */
@Api(name = "event",
version = "v1",
namespace = @ApiNamespace(ownerDomain =
"backend.myapplication.Kendrickod.example.com",
ownerName = "backend.myapplication.Kendrickod.example.com",
packagePath = ""),
authenticators = {EspAuthenticator.class},
issuers = {
@ApiIssuer(
name = "firebase",
issuer = "https://securetoken.google.com/YOUR-PROJECT-ID",
jwksUri = "https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com")
},
issuerAudiences = {
@ApiIssuerAudience(name = "firebase", audiences = "YOUR-PROJECT-ID")
},
clientIds = {Constants.WEB_CLIENT_ID, Constants.ANDROID_CLIENT_ID, Constants.IOS_CLIENT_ID},
audiences = {Constants.ANDROID_AUDIENCE})
public class EventApi {
}
你必须包括这个图书馆
com.google.endpoints:endpoints-framework-auth:1.0.2
这似乎微不足道,但不容易找到。。。我得把它们都试一下
如果您使用Android Studio,请转到构建/编辑库和依赖项,单击“+”并搜索“端点框架”您必须包含此库
com.google.endpoints:endpoints-framework-auth:1.0.2
这似乎微不足道,但不容易找到。。。我得把它们都试一下
如果您使用Android Studio,请转到构建/编辑库和依赖项,单击“+”并搜索“endpoints framework”抱歉,您还必须导入com.google.endpoints:endpoints framework库,并注意将它们放在所有其他库之前。。。这就是全部!非常感谢。这就成功了。我觉得这和我的库有关。对不起,你还必须导入com.google.endpoints:endpoints框架库,并注意将它们放在所有其他库之前。。。这就是全部!非常感谢。这就成功了。我觉得这和我的图书馆有关。