# 使用 Homebrew, apk, MacPorts, Nix 安装 oauth2_proxy

查看 oauth2_proxy 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:oauth2_proxy
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install oauth2_proxy
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install oauth2-proxy
```

  证据: MacPorts ports tree: security/oauth2-proxy/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add oauth2-proxy
```

  证据: Alpine Linux edge package indexes: oauth2-proxy from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#oauth2-proxy
```

  证据: nixpkgs package indexes: pkgs/by-name/oa/oauth2-proxy/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:oauth2_proxy
- **软件包管理器:** Homebrew
- **版本:** 7.15.3
- **来源摘要:** Reverse proxy for authenticating users via OAuth 2 providers
- **主页:** <https://oauth2-proxy.github.io/oauth2-proxy/>
- **仓库:** <https://github.com/oauth2-proxy/oauth2-proxy>
- **最后更新:** 2026-07-27T23:46:49+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- oauth2-proxy (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 7.15.3
## 项目历史与用法

OAuth2 Proxy is an authenticating reverse proxy and middleware component that protects web applications with OAuth2 and OpenID Connect login flows. It sits in front of applications that do not implement identity themselves and validates users by provider, email, domain, group, and related identity attributes.

### 项目历史

The project descends from Bitly's oauth2_proxy. The maintained repository was forked from bitly/OAuth2_Proxy on November 27, 2018, with v3.0.0 and later coming from the fork. On March 29, 2020, the project moved from pusher/oauth2_proxy to oauth2-proxy/oauth2-proxy, and the binary naming and container image paths followed that rename.

### 采用历史

OAuth2 Proxy became a common cloud-native building block because it lets teams add SSO in front of dashboards, admin apps, APIs, and legacy services without modifying the upstream application. CNCF lists OAuth2 Proxy as a Sandbox project accepted on October 2, 2025, which reflects its role as shared identity infrastructure rather than a single-vendor utility.

### 使用方式

Operators deploy oauth2-proxy as a standalone reverse proxy or as an auth middleware integrated with Nginx auth_request, Kubernetes ingress-nginx, Traefik ForwardAuth, Envoy, and similar reverse-proxy stacks. It redirects unauthenticated users to providers such as Google, GitHub, Microsoft Entra ID, login.gov, or a generic OIDC provider, then forwards identity and token information to upstream services through headers when configured.

The project ships compiled binaries, container images, nightly images, and package-manager formulas. Configuration normally combines provider credentials, cookie/session settings, upstream routes, and reverse-proxy headers; larger OIDC sessions can use Redis-backed session storage.

### 为什么软件包爱好者会关心

OAuth2 Proxy is significant because it packages identity as a proxy executable: one binary can retrofit OAuth2/OIDC authentication onto applications, Kubernetes ingresses, and internal tools. Its history also mirrors open-source operations reality: a vendor-originated project, a community fork, an organizational rename, and eventual CNCF Sandbox governance.

### 时间线

- 2017-09-29: oauth2-proxy/oauth2-proxy repository record was created on GitHub.
- 2018-11-27: The maintained repository forked from bitly/OAuth2_Proxy.
- 2020-03-29: The project was renamed from pusher/oauth2_proxy to oauth2-proxy/oauth2-proxy.
- 2025-10-02: CNCF accepted OAuth2 Proxy at Sandbox maturity.
- 2026-06-09: GitHub release v7.15.3 was published.

### Related projects

- OAuth2 Proxy is commonly paired with Nginx, ingress-nginx, Traefik, Envoy-style reverse proxies, Kubernetes, Redis session storage, and external identity providers. Related identity-layer projects include Dex, Pomerium, Authelia, Ory Oathkeeper, and cloud-provider access proxies.

### 来源

- <https://api.github.com/repos/oauth2-proxy/oauth2-proxy>
- <https://formulae.brew.sh/formula/oauth2_proxy>
- <https://github.com/bitly/oauth2_proxy>
- <https://github.com/cncf/sandbox/issues/397>
- <https://github.com/oauth2-proxy/oauth2-proxy>
- <https://github.com/oauth2-proxy/oauth2-proxy/releases>
- <https://oauth2-proxy.github.io/oauth2-proxy/>
- <https://oauth2-proxy.github.io/oauth2-proxy/configuration/integration/>
- <https://www.cncf.io/projects/oauth2-proxy/>


## 安全说明

formula declares a Homebrew service.

- **Geiger 风险:** orange / 中
- formula declares a Homebrew service


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: /etc/oauth2-proxy.cfg
## 其他软件包管理器记录

- Nix - oauth2-proxy: normalized package name match | nixpkgs package indexes: pkgs/by-name/oa/oauth2-proxy/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - oauth2-proxy - 7.15.2-r2: normalized package name match | Alpine Linux edge package indexes: oauth2-proxy from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Reverse proxy that provides authentication with Google, Azure, OpenID Connect and many more identity providers | https://oauth2-proxy.github.io/oauth2-proxy
- apk - oauth2-proxy-openrc - 7.15.2-r2: normalized package name match | Alpine Linux edge package indexes: oauth2-proxy-openrc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Reverse proxy that provides authentication with Google, Azure, OpenID Connect and many more identity providers (OpenRC init scripts) | https://oauth2-proxy.github.io/oauth2-proxy
- MacPorts - oauth2-proxy: normalized package name match | MacPorts ports tree: security/oauth2-proxy/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/oauth2_proxy.yml](https://github.com/mxcl/pkgdb/blob/main/combined/oauth2_proxy.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
