Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
dcbe67d8
Commit
dcbe67d8
authored
Oct 07, 2016
by
Eric Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
{cmd/dex,server}: expose skip approval screen option
parent
182f14fb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
config.go
cmd/dex/config.go
+3
-0
serve.go
cmd/dex/serve.go
+1
-0
server.go
server/server.go
+5
-1
No files found.
cmd/dex/config.go
View file @
dcbe67d8
...
@@ -72,6 +72,9 @@ func (p password) toPassword() (storage.Password, error) {
...
@@ -72,6 +72,9 @@ func (p password) toPassword() (storage.Password, error) {
// OAuth2 describes enabled OAuth2 extensions.
// OAuth2 describes enabled OAuth2 extensions.
type
OAuth2
struct
{
type
OAuth2
struct
{
ResponseTypes
[]
string
`yaml:"responseTypes"`
ResponseTypes
[]
string
`yaml:"responseTypes"`
// If specified, do not prompt the user to approve client authorization. The
// act of logging in implies authorization.
SkipApprovalScreen
bool
`yaml:"skipApprovalScreen"`
}
}
// Web is the config format for the HTTP server.
// Web is the config format for the HTTP server.
...
...
cmd/dex/serve.go
View file @
dcbe67d8
...
@@ -116,6 +116,7 @@ func serve(cmd *cobra.Command, args []string) error {
...
@@ -116,6 +116,7 @@ func serve(cmd *cobra.Command, args []string) error {
serverConfig
:=
server
.
Config
{
serverConfig
:=
server
.
Config
{
SupportedResponseTypes
:
c
.
OAuth2
.
ResponseTypes
,
SupportedResponseTypes
:
c
.
OAuth2
.
ResponseTypes
,
SkipApprovalScreen
:
c
.
OAuth2
.
SkipApprovalScreen
,
Issuer
:
c
.
Issuer
,
Issuer
:
c
.
Issuer
,
Connectors
:
connectors
,
Connectors
:
connectors
,
Storage
:
s
,
Storage
:
s
,
...
...
server/server.go
View file @
dcbe67d8
...
@@ -41,6 +41,10 @@ type Config struct {
...
@@ -41,6 +41,10 @@ type Config struct {
// flow. If no response types are supplied this value defaults to "code".
// flow. If no response types are supplied this value defaults to "code".
SupportedResponseTypes
[]
string
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.
RotateKeysAfter
time
.
Duration
// Defaults to 6 hours.
IDTokensValidFor
time
.
Duration
// Defaults to 24 hours
IDTokensValidFor
time
.
Duration
// Defaults to 24 hours
...
@@ -73,7 +77,6 @@ type Server struct {
...
@@ -73,7 +77,6 @@ type Server struct {
templates
*
templates
templates
*
templates
// If enabled, don't prompt user for approval after logging in through connector.
// 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
skipApproval
bool
supportedResponseTypes
map
[
string
]
bool
supportedResponseTypes
map
[
string
]
bool
...
@@ -145,6 +148,7 @@ func newServer(c Config, rotationStrategy rotationStrategy) (*Server, error) {
...
@@ -145,6 +148,7 @@ func newServer(c Config, rotationStrategy rotationStrategy) (*Server, error) {
),
),
supportedResponseTypes
:
supported
,
supportedResponseTypes
:
supported
,
idTokensValidFor
:
value
(
c
.
IDTokensValidFor
,
24
*
time
.
Hour
),
idTokensValidFor
:
value
(
c
.
IDTokensValidFor
,
24
*
time
.
Hour
),
skipApproval
:
c
.
SkipApprovalScreen
,
now
:
now
,
now
:
now
,
templates
:
tmpls
,
templates
:
tmpls
,
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment