title: Google Identity Aware Proxy for Two Different Backend Service using same domain
body: <p>I have the a use case where I need to integrate two different service using a fanout ingress (different path). I decide to do so because both services is actually related so I don't want to separate the domain. Another reason is I don't want to use another ingress. However, this problem arises, I understand that once I activate Google IAP, a new clientId and secretId will be created. And the redirect javascript url should be a domain (doesn't include any path or in it's wildcard form). </p>
  
  <p>I'm tring to access https://{my-domain}/{some-path}. It turns out I got the following error.</p>
  
  <ol start="400">
  <li>That’s an error.</li>
  </ol>
  
  <p>Error: redirect_uri_mismatch</p>
  
  <blockquote>
    <p>The redirect URI in the request,
    https://{my-domain}/_gcp_gatekeeper/authenticate, does not match the
    ones authorized for the OAuth client. To update the authorized
    redirect URIs, visit:
    <a href="https://console.developers.google.com/apis/credentials/oauthclient/" rel="nofollow noreferrer">https://console.developers.google.com/apis/credentials/oauthclient/</a></p>
  </blockquote>
  
  <p>This is my ingress config:</p>
  
  <pre><code>apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    annotations:
      kubernetes.io/ingress.allow-http: "false"
      kubernetes.io/ingress.global-static-ip-name: &lt;some-static-ip&gt;
    name: &lt;name&gt;
    namespace: &lt;namespace&gt;
  spec:
    backend:
      serviceName: &lt;service-1&gt;
      servicePort: &lt;port-of-service-1&gt;
    rules:
    - http:
        paths:
        - backend:
            serviceName: &lt;service-2&gt;
            servicePort: &lt;port-of-service-2&gt;
          path: /&lt;some-path&gt;/*
    tls:
    - secretName: &lt;secret-name&gt;
  </code></pre>
  
  <p>However when I tried to access my 1st service it just fine and works as expected.</p>
  
  <p>Just wondering if it's possible to create IAP for two different backend services using the same ingress. I don't manage to find more about this tho. Thanks!</p>
  
  <p>Best,</p>