I am making a script to get google analytics data using API in php. I am able to fetch data through API, using service accounts model. Now I want to restrict that API to only return data, if API calls are made from a specific defined IP. I am unable to find any such setting in Google API console.Is there some way to achieve this goal?
Asked
Active
Viewed 126 times
0
-
You cant set a service account to only allow access from one IP, you can with Oauth but not with service accounts. – Linda Lawton - DaImTo Sep 23 '16 at 10:32
1 Answers
0
Google Analytics API can not be restricted based on user's IP address using service accounts via the mode of authentication. It can be done if it's done via oAuth2.

turtlepower
- 708
- 1
- 7
- 18
-
It can if you use Oauth2, however not if you use service accounts . Access to an API is controlled via the mode of authentication. APIs don't restrict this. Want to edit your answer please and I will upvote it – Linda Lawton - DaImTo Sep 23 '16 at 10:31