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

Login with Google for nginx

· 52CE 我爱测

I have a nginx server serving protected resources. The last thing I want to do is manage password reset requests, so I was looking at Login with Google . They have examples for PHP, Java, JavaScript etc., but not for Apache or ng…

问题原文

原帖链接 · stwissel · CC BY-SA 3.0

I have a nginx server serving protected resources. The last thing I want to do is manage password reset requests, so I was looking at Login with Google.

They have examples for PHP, Java, JavaScript etc., but not for Apache or nginx. How can I configure nginx to swap out basic authentication with the Login with Google functionality?

Some proxied systems behind depend on the %REMOTE_USER% variable, so I need that one preserved. Help is appreciated.

Update To clarify: I have a set of services (a tomcat, a node.js, a couchdb, a vert.x, some python) that sit behind the web server, that might or might not authorize a user to interact with them. They all have in common, that they can receive identity information from the web tier.

So what I do in the web tier: specify - "authenticated users only" (which is a authorization setting, I "reuse" to trigger the authentication mechanism).

Once the user is authenticated, that identity information is passed on. For an example with basic authentication and CouchDB, check this blog entry. I can do the same in nginx, but the task here is to burden someone else with keeping a password secret using identities established with an outside provider.

已采纳解答

原帖链接 · Kevin Chen · CC BY-SA 4.0

Maybe you could run the oauth2_proxy in front of your web app.

A reverse proxy and static file server that provides authentication using Providers (Google, GitHub, and others) to validate accounts by email, domain or group.

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

资料来源与适用范围

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

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

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