feat: add OIDC authentication for server mode
This commit is contained in:
@@ -15,6 +15,7 @@ type fileConfig struct {
|
||||
UserAliases []*Alias `json:"aliases"`
|
||||
Serve ServerConfig `json:"serve"`
|
||||
Remote ServerConfig `json:"remote"`
|
||||
OIDC OIDCConfig `json:"oidc"`
|
||||
}
|
||||
|
||||
var defaultAliases = []*Alias{
|
||||
@@ -142,6 +143,17 @@ func (c *fileConfig) ListAliases() ([]*Alias, error) {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (c *fileConfig) GetOIDCConfig() (OIDCConfig, bool) {
|
||||
if c.OIDC.Issuer == "" {
|
||||
return OIDCConfig{}, false
|
||||
}
|
||||
cfg := c.OIDC
|
||||
if cfg.UserClaim == "" {
|
||||
cfg.UserClaim = "preferred_username"
|
||||
}
|
||||
return cfg, true
|
||||
}
|
||||
|
||||
func (c *fileConfig) GetRemoteConfig() (ServerConfig, bool) {
|
||||
if c.Remote.Host == "" {
|
||||
return ServerConfig{}, false
|
||||
|
||||
Reference in New Issue
Block a user