Ian Meier
Ian Meier

Reputation: 41

API Key Restrictions for iOS Apps with Bundle Identifier

When calling https://servicecontrol.googleapis.com/v1/services/{serviceName}:check, how is the bundle identifier supposed to be passed so that an API key can be validated for an iOS app restricted to a bundle identifier? I'm passing in "api_key:[my_key]" as the consumerId, and have tried passing the bundle identifier as the user agent, referrer, platform, and service agent (all via labels). I'm getting the following error back for each of these attempts:

"checkErrors": [
{
"code": "CLIENT_APP_BLOCKED",
"detail": "Requests from this ios client application \u003cempty\u003e are blocked."
}
],

Is there a way to pass the bundle id in?

Thanks, Ian

Upvotes: 3

Views: 1853

Answers (2)

zhywu
zhywu

Reputation: 1060

X-Ios-Bundle-Identifier header needs to be set with your bundle id

Upvotes: 7

Ian Meier
Ian Meier

Reputation: 41

The bundle identifier is passed in via the servicecontrol.googleapis.com/ios_bundle_id operation label.

I was provided this information via the following thread: https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!topic/google-cloud-endpoints/I-u3sAUU3Ts. I've made changes to the python endpoints management code as documented by the following pull request: https://github.com/cloudendpoints/endpoints-management-python/pull/28.

Upvotes: 1

Related Questions