大网数据广告活动
服务器运维问答

How to enable IAP for k8s on GCP?

· 52CE 我爱测

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 e…

问题原文

原帖链接 · 030 · CC BY-SA 4.0

Aim: to enable Identity Aware Proxy (IAP) in conjunction with Kubernetes (k8s).

Methods:

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-05-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。