python-docs-samples icon indicating copy to clipboard operation
python-docs-samples copied to clipboard

Question: 403 err occurs when running make_iap_request.py

Open liangway opened this issue 7 years ago • 5 comments

In which file did you encounter the issue?

https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/iap/make_iap_request.py

Did you change the file? If so, how?

import os

if name == 'main': os.environ[ "GOOGLE_APPLICATION_CREDENTIALS"] = '/Users/foo/bar.json'

print make_iap_request('https://foo.com/', 'xxxxtheidforthatiapservice.apps.googleusercontent.com')

Describe the issue

Trying to let a python command line to access(HTTP GET) IAP-protected application.

With https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/iap/make_iap_request.py

But 403 err occurs Exception: Service account [email protected] does not have permission to access the IAP-protected application.

Following methods have been tried, but still issue persists as above 1. remove/create the service account 2. re-create the json key file 3. grant the service account project owner permission

also posted on https://stackoverflow.com/questions/55349308/access-denied-for-service-account-when-accessing-iap-protected-application

liangway avatar Mar 26 '19 03:03 liangway

Could you try checking your GOOGLE_APPLICATION_CREDENTIALS variable? I found the same error using Vision API, the I exported the environment variable, and then it works. check this link for more info

ezetina86 avatar May 29 '19 15:05 ezetina86

@afitz0 is this issue fixed (or non-issue)?

andrewferlitsch avatar Oct 01 '19 00:10 andrewferlitsch

@andrewferlitsch neither; it's unowned.

afitz0 avatar Oct 01 '19 01:10 afitz0

@sgreenberg Can you assign this to someone. don't know who would cover this.

andrewferlitsch avatar Oct 07 '19 17:10 andrewferlitsch

Closing due to lack of activity and that a possible solution was given. Feel free to re-open if more investigation needs to happen!

leahecole avatar Nov 15 '19 23:11 leahecole