admin: Generate Vouch-Proxy config
This commit is contained in:
parent
59af4103b8
commit
5974fe8cd4
2 changed files with 16 additions and 17 deletions
|
@ -280,24 +280,24 @@ vouch:
|
|||
document_root: /challenge_access
|
||||
|
||||
cookie:
|
||||
domain: {{ .Issuer }}
|
||||
domain: {{ .Domain }}
|
||||
|
||||
oauth:
|
||||
provider: oidc
|
||||
client_id: {{ .ClientId }}
|
||||
client_secret: {{ .ClientSecret }}
|
||||
callback_urls:
|
||||
- https://{{ .Issuer }}/challenge_access/auth
|
||||
auth_url: https://{{ .Issuer }}/auth
|
||||
token_url: http://127.0.0.1:5556/token
|
||||
user_info_url: http://127.0.0.1:5556/userinfo
|
||||
scopes:
|
||||
- openid
|
||||
- email
|
||||
oauth:
|
||||
provider: oidc
|
||||
client_id: {{ .ClientId }}
|
||||
client_secret: {{ .ClientSecret }}
|
||||
callback_urls:
|
||||
- https://{{ .Domain }}/challenge_access/auth
|
||||
auth_url: https://{{ .Domain }}/auth
|
||||
token_url: http://127.0.0.1:5556/token
|
||||
user_info_url: http://127.0.0.1:5556/userinfo
|
||||
scopes:
|
||||
- openid
|
||||
- email
|
||||
`
|
||||
|
||||
type vouchProxyConfig struct {
|
||||
Issuer string
|
||||
Domain string
|
||||
ClientId string
|
||||
ClientSecret string
|
||||
}
|
||||
|
@ -312,7 +312,7 @@ func genVouchProxyConfig() ([]byte, error) {
|
|||
if vouchTmpl, err := template.New("vouchcfg").Parse(vouchcfgtpl); err != nil {
|
||||
return nil, fmt.Errorf("Cannot create template: %w", err)
|
||||
} else if err = vouchTmpl.Execute(b, vouchProxyConfig{
|
||||
Issuer: "https://" + OidcIssuer,
|
||||
Domain: OidcIssuer,
|
||||
ClientId: OidcClientId,
|
||||
ClientSecret: OidcSecret,
|
||||
}); err != nil {
|
||||
|
|
Reference in a new issue