You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 30, 2023. It is now read-only.
I am making a request from an appengine javascript frontend at project-id.appspot.com (default service) with a firebase id token to a cloud endpoint at service-name-dot-project-id.appspot.com. The cloud endpoint uses annotations for firebase auth (see below). However, the call from the client fails due to "No 'Access-Control-Allow-Origin' header is present on the requested resource." This does not happen without the firebase auth annotations on the endpoint. These release notes suggest it is due to EspAuthenticator preventing cross origin resource sharing: https://cloud.google.com/endpoints/docs/release-notes#january_2017. "By default, ESP will block cross-origin requests by rejecting all OPTIONS requests" - from release notes. It states that "allowCors" : "true" can be added to the openapi.json but the documentation is outdated. There is also no synonymous java annotation documented. How can I make a request from my default module front end to a non-default service cloud endpoint using firebase tokens?
@Api(
name = "firebaseauthtest",
version = "v2",
apiKeyRequired = AnnotationBoolean.TRUE,
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)
},
namespace =
@ApiNamespace(
ownerDomain = DOMAIN,
ownerName = DOMAIN,
packagePath = "myproject/endpoints"
)
)