{cmd/dex,server}: expose skip approval screen option

This commit is contained in:
Eric Chiang
2016-10-07 11:53:01 -07:00
parent 182f14fb30
commit dcbe67d89c
3 changed files with 9 additions and 1 deletions

View File

@@ -41,6 +41,10 @@ type Config struct {
// flow. If no response types are supplied this value defaults to "code".
SupportedResponseTypes []string
// If enabled, the server won't prompt the user to approve authorization requests.
// Logging in implies approval.
SkipApprovalScreen bool
RotateKeysAfter time.Duration // Defaults to 6 hours.
IDTokensValidFor time.Duration // Defaults to 24 hours
@@ -73,7 +77,6 @@ type Server struct {
templates *templates
// If enabled, don't prompt user for approval after logging in through connector.
// No package level API to set this, only used in tests.
skipApproval bool
supportedResponseTypes map[string]bool
@@ -145,6 +148,7 @@ func newServer(c Config, rotationStrategy rotationStrategy) (*Server, error) {
),
supportedResponseTypes: supported,
idTokensValidFor: value(c.IDTokensValidFor, 24*time.Hour),
skipApproval: c.SkipApprovalScreen,
now: now,
templates: tmpls,
}