-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.go
More file actions
36 lines (30 loc) · 1 KB
/
config.go
File metadata and controls
36 lines (30 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package handlers
// globalConfig holds the global OAuth2/OIDC configuration.
// It is used by authentication handlers.
var globalConfig *Config
// Config holds the OAuth2/OIDC configuration for handlers.
type Config struct {
// OAuth2 Configuration (shared across all flows)
AuthAllowedClientID string
AuthAllowedClientSecret string
AuthSupportedScopes []string
AuthTokenExpiry int
AuthAllowedGrantTypes []string
// Resource Owner Password Credentials / Basic Auth
AuthAllowedUsername string
AuthAllowedPassword string
// Authorization Code Flow Configuration
AuthCodeRequirePKCE bool
AuthCodeSessionTTL int
AuthCodeValidateRedirectURI bool
AuthCodeAllowedRedirectURIs string
}
// SetConfig sets the global configuration for handlers.
func SetConfig(cfg *Config) {
globalConfig = cfg
}
// GetConfig returns the global configuration for handlers.
// This function will be used by OIDC handlers in Milestone 2 and beyond.
func GetConfig() *Config {
return globalConfig
}