1

I'm setting Cloud Run app in GCP. I'm want to use the IAP framework. In my development environment I want to get the headers provided by the IAP. Is there a best practice for this without hardcoding?

I'm using vscode and docker.

I want to be able to access, among others, X-Goog-Authenticated-User-Email

Asken
  • 7,679
  • 10
  • 45
  • 77
  • 1
    You want to simulate some headers in the requests received by your container? IAP on Cloud Run sounds strange no? – guillaume blaquiere Jun 03 '20 at 18:37
  • If you secure your app with IAP headers, the ID token's payload would contains X-Goog-Authenticated-User-Email. There are some code examples [here](https://cloud.google.com/iap/docs/signed-headers-howto#retrieving_the_user_identity). But as per the comment above, can you explain more about how you would like to use IAP in Cloud Run??? – Judith Guzman Jun 04 '20 at 13:38

1 Answers1

0

If you secure your app with IAP headers, the ID token's payload would contain the X-Goog-Authenticated-User-Email value you're looking for . There are some code examples here.

Judith Guzman
  • 415
  • 3
  • 11