问题原文
原帖链接 · 030 · CC BY-SA 4.0
Aim: to enable Identity Aware Proxy (IAP) in conjunction with Kubernetes (k8s).
Methods:
- Two apps were deployed
- A SSL load balancer was put in front
- When one navigates to domain/app1, app1 is shown
- This tutorial was followed to enable IAP for k8s https://cloud.google.com/iap/docs/enabling-kubernetes-howto
Results
- The Google login screen appears when one navigates to domain/app1
- When the login succeeds a ‘default gateway - 404’ is shown instead of the app when IAP is disabled
Discussion
- Should a redirect not be configured somewhere? When the authentication and authorization succeeds a URI _gcp_gatekeeper/authenticate was added and a 404 was returned, while a redirect to the app should be done right?
- When an App engine is deployed, IAP is enable the IAP works out of the box. What makes this deploy different? Perhaps App Engine contains some elements that are omitted in k8s.
Current problem
When the authentication succeeds the following error is shown:
There was a problem with your request. Error code 11
已采纳解答
原帖链接 · VAS · CC BY-SA 4.0
To begin with, here’s some general information:
To get started with IAP in GCP, add an App Engine app or configure Cloud Load Balancer for IAP. In case you are running Kubernetes cluster, you may have the Load Balancer configured already.
Then you should enable IAP for it here: Menu -> Security -> Identity-Aware Proxy
And finally, that is the place where redirect URI can be configured. You can get there from previous step by selecting triple dot on the right side of your App/LB and choosing Edit OAuth Client.
Menu -> APIs & Services -> Credentials
Create OAuth clientID and set Authorized redirect URIs for it.
Authorized redirect URIs
For use with requests from a web server. This is the path in your application that users are redirected to after they have authenticated with Google. The path will be appended with the authorization code for access. Must have a protocol. Cannot contain URL fragments or relative paths. Cannot be a public IP address.
For App Engine apps this value is predefined, but you can adjust it according to your needs.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
