sohopOAuth 認(rèn)證反向代理
sohop 是一個反向代理,可以選擇性地限制對使用 OAuth 進(jìn)行身份驗(yàn)證的用戶的訪問權(quán)限。它還提供一個運(yùn)行狀況檢查端點(diǎn),用于報(bào)告上游服務(wù)的可達(dá)性。
sohop 可以在保持限制訪問的情況下,公開原有的內(nèi)部應(yīng)用到公共互聯(lián)網(wǎng),而不必在應(yīng)用本身配置認(rèn)證/授權(quán)。
Usage
Usage of sohop: -config string Config file (default "config.json") -httpAddr string Address to bind HTTP server (default ":80") -httpsAddr string Address to bind HTTPS server (default ":443")
配置示例
{
"Domain": "example.com",
"Cookie": {
"Name": "exampleauth",
"Secret": "3c0767ada2466a92a59c1214061441713aeafe6d115e29aa376c0f9758cdf0f5"
},
"Auth" : {
"Type": "github-org",
"Config": {
"ClientID": "12345678",
"ClientSecret": "12345678",
"OrgID": 12345678
}
},
"TLS": {
"CertFile": "cert.pem",
"CertKey": "key.pem"
},
"Upstreams": {
"intranet": {
"URL": "http://10.0.0.16:8888",
"HealthCheck": "http://10.0.0.16:8888/login",
"WebSocket": "ws://10.0.0.16:8888",
"Auth": true,
"Headers": { "X-WEBAUTH-USER":["{{.Session.Values.user}}"] }
},
"public": {
"URL": "http://10.0.0.16:8111",
"HealthCheck": "http://10.0.0.16:8111/login.html",
"WebSocket": "ws://10.0.0.16:8111",
"Auth": false
}
}
}
{
"Domain": "example.com",
"Auth" : {
"Type": "gmail-regex",
"Config": {
"Credentials": {"web":{"client_id":"XXXX-yyyyyy.apps.googleusercontent.com","project_id":"example","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://accounts.google.com/o/oauth2/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"zzzzZZzzZZ","redirect_uris":["https://oauth.example.com/authorized"]}},
"EmailRegex":"^[email protected]$"
}
},
"Upstreams": {
...
}
}評論
圖片
表情
