Hello, I see *in this link* <https://stackoverflow.com/questions/67701342/service-to-service-requests-on-app-engine-with-iap> there is an identical post in Stack Overflow, with a good answer, I share it here if anyone else is facing the same issue.
Regards. On Thursday, May 27, 2021 at 10:27:42 AM UTC+2 [email protected] wrote: > I'm using Google App Engine to host a couple of services (a NextJS > <https://nextjs.org/> SSR service and a backend API built on Express). > I've setup my dispatch.yaml file to route /api/* requests to my API service > and all other requests get routed to the default (NextJS) service > Dispatch.yaml: > dispatch: > - url: '*/api/*' service: api > > The problem: I've also turned on Identity-Aware Proxy for App Engine. When > I try to make a GET request from my NextJS service to my API (server-side, > via getServerSideProps) it triggers the IAP sign-in page again instead of > hitting my API. I've tried out a few ideas to resolve this: > > 1. Forwarding all cookies in the API request > 2. Setting the X-Requested-With header as mentioned here > > <https://cloud.google.com/iap/docs/sessions-howto#understanding_the_response> > 3. Giving IAP-secured Web App User permissions to my App Engine > default service account > > But nothing seems to work. I've confirmed that turning off IAP for App > Engine allows everything to function as expected. Any requests to the API > from the frontend also work as expected. Is there a solution I'm missing or > a workaround for this? > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/2404332e-5860-48a4-8d4b-e4133bb86175n%40googlegroups.com.
