Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dex
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hdacloud
dex
Commits
8518c301
Commit
8518c301
authored
8 years ago
by
Eric Chiang
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #593 from ericchiang/dev-expose-skip-approval
dev branch: expose skip approval screen option
parents
b7841fb9
dcbe67d8
Branches
Branches containing commit
Tags
v2.0.0-alpha.2
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmd/dex/config.go
+3
-0
3 additions, 0 deletions
cmd/dex/config.go
cmd/dex/serve.go
+1
-0
1 addition, 0 deletions
cmd/dex/serve.go
server/server.go
+5
-1
5 additions, 1 deletion
server/server.go
with
9 additions
and
1 deletion
cmd/dex/config.go
+
3
−
0
View file @
8518c301
...
...
@@ -72,6 +72,9 @@ func (p password) toPassword() (storage.Password, error) {
// OAuth2 describes enabled OAuth2 extensions.
type
OAuth2
struct
{
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.
...
...
This diff is collapsed.
Click to expand it.
cmd/dex/serve.go
+
1
−
0
View file @
8518c301
...
...
@@ -116,6 +116,7 @@ func serve(cmd *cobra.Command, args []string) error {
serverConfig
:=
server
.
Config
{
SupportedResponseTypes
:
c
.
OAuth2
.
ResponseTypes
,
SkipApprovalScreen
:
c
.
OAuth2
.
SkipApprovalScreen
,
Issuer
:
c
.
Issuer
,
Connectors
:
connectors
,
Storage
:
s
,
...
...
This diff is collapsed.
Click to expand it.
server/server.go
+
5
−
1
View file @
8518c301
...
...
@@ -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
,
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment