Google app engine 端点上的身份验证引发InvocationTargetexception
在那里。 我用Google云引擎创建了一个API,它使用Firebase进行身份验证。但我总是调用此Api,响应是:Google app engine 端点上的身份验证引发InvocationTargetexception,google-app-engine,firebase,google-cloud-endpoints,Google App Engine,Firebase,Google Cloud Endpoints,在那里。 我用Google云引擎创建了一个API,它使用Firebase进行身份验证。但我总是调用此Api,响应是: { "error": { "errors": [ { "domain": "global", "reason": "badRequest", "message": "java.lang.reflect.InvocationTargetException" } ], "code": 400, "message": "java.lang.reflect
{
"error": {
"errors": [
{
"domain": "global",
"reason": "badRequest",
"message": "java.lang.reflect.InvocationTargetException"
}
],
"code": 400,
"message": "java.lang.reflect.InvocationTargetException"
}
}
在删除参数“User User”的情况下,我得到了200个成功响应
这是我的代码:
@Api(
name = "crumb",
version="v2",
authenticators = {EspAuthenticator.class},
issuers = {
@ApiIssuer(
name = "firebase",
issuer = "https://securetoken.google.com/[Project-ID]",
jwksUri = "https://www.googleapis.com/service_accounts/v1/metadata/x509/securetoken@system.gserviceaccount.com")
},
issuerAudiences = {
@ApiIssuerAudience(name = "firebase", audiences = "[Project-ID]")
}
)
public class crumbAPI {
@ApiMethod(name = "getCrumbById",path = "{crumbId}",httpMethod = ApiMethod.HttpMethod.GET)
public Object getCrumbById(User user, @Named("crumbId") String crumbId) throws IOException, NotFoundException, UnauthorizedException {
if (user == null) {
throw new UnauthorizedException("Invalid credentials");
}
CrumbInfo ci = CrumbInfo.entityToCrumb(crumbId);
Bean response = new Bean();
response.setData(ci);
return response;
}
}
我用它作为参考:你找到答案了吗?你找到答案了吗?