「Oauth2-proxy」:修訂間差異
创建页面,内容为“{{Lowercase}} '''oauth2-proxy'''是一套綁定SSO(Single Sign-on)認證的工具。 == 外部連結 == * {{Official|https://github.com/oauth2-proxy/oauth2-proxy}} Category:軟體” |
無編輯摘要 |
||
第1行: | 第1行: | ||
{{Lowercase}} | {{Lowercase}} | ||
'''oauth2-proxy'''是一套綁定SSO(Single Sign-on)認證的工具。 | '''oauth2-proxy'''是一套綁定SSO(Single Sign-on)認證的工具。 | ||
== 安裝 == | |||
這邊建議安裝在service使用者帳號下,或是<code>/srv</code>下: | |||
<syntaxhighlight lang="bash"> | |||
export OAUTH2_PROXY_VERSION=7.5.1; wget -c https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v${OAUTH2_PROXY_VERSION}/oauth2-proxy-v${OAUTH2_PROXY_VERSION}.linux-amd64.tar.gz; tar xvf oauth2-proxy-v${OAUTH2_PROXY_VERSION}.linux-amd64.tar.gz; mkdir oauth2-proxy; cd oauth2-proxy; ln -s ../oauth2-proxy-v${OAUTH2_PROXY_VERSION}/oauth2-proxy | |||
</syntaxhighlight> | |||
== 設定 == | |||
另外在<code>oauth2-proxy/oauth2-proxy.conf</code>裡面設定。其中 | |||
* <code>cookie_secret</code>可以用官方建議的<code>openssl rand -base64 32 | tr -- '+/' '-_'</code>產生。 | |||
* <code>email_domains</code>表示只有這個網段下面的使用者才能存取系統。 | |||
* <code>http_address</code>表示服務的接點(像是給[[nginx]]用)。 | |||
* <code>upstreams</code>表示後端的接點(像是接到[[etcd-adminer]])。 | |||
* <code>client_id</code>與<code>client_secret</code>則是由Google產生給的值。 | |||
<syntaxhighlight lang="ini"> | |||
# | |||
cookie_secret = "x" | |||
cookie_secure = true | |||
email_domains = ["example.com"] | |||
http_address = "127.0.0.1:8002" | |||
upstreams = ["http://127.0.0.1:8001/"] | |||
# | |||
client_id = "x" | |||
client_secret = "x" | |||
</syntaxhighlight> | |||
== 外部連結 == | == 外部連結 == |
於 2023年10月24日 (二) 16:58 的修訂
oauth2-proxy是一套綁定SSO(Single Sign-on)認證的工具。
安裝
這邊建議安裝在service使用者帳號下,或是/srv
下:
export OAUTH2_PROXY_VERSION=7.5.1; wget -c https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v${OAUTH2_PROXY_VERSION}/oauth2-proxy-v${OAUTH2_PROXY_VERSION}.linux-amd64.tar.gz; tar xvf oauth2-proxy-v${OAUTH2_PROXY_VERSION}.linux-amd64.tar.gz; mkdir oauth2-proxy; cd oauth2-proxy; ln -s ../oauth2-proxy-v${OAUTH2_PROXY_VERSION}/oauth2-proxy
設定
另外在oauth2-proxy/oauth2-proxy.conf
裡面設定。其中
cookie_secret
可以用官方建議的openssl rand -base64 32 | tr -- '+/' '-_'
產生。email_domains
表示只有這個網段下面的使用者才能存取系統。http_address
表示服務的接點(像是給nginx用)。upstreams
表示後端的接點(像是接到etcd-adminer)。client_id
與client_secret
則是由Google產生給的值。
#
cookie_secret = "x"
cookie_secure = true
email_domains = ["example.com"]
http_address = "127.0.0.1:8002"
upstreams = ["http://127.0.0.1:8001/"]
#
client_id = "x"
client_secret = "x"