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
bc8c2276
Unverified
Commit
bc8c2276
authored
2 years ago
by
Maksim Nabokikh
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fail if OIDC config contains hosted domains (#2937)
Signed-off-by:
m.nabokikh
<
maksim.nabokikh@flant.com
>
parent
34a8aa23
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
connector/oidc/oidc.go
+12
-0
12 additions, 0 deletions
connector/oidc/oidc.go
with
12 additions
and
0 deletions
connector/oidc/oidc.go
+
12
−
0
View file @
bc8c2276
...
@@ -35,6 +35,14 @@ type Config struct {
...
@@ -35,6 +35,14 @@ type Config struct {
Scopes
[]
string
`json:"scopes"`
// defaults to "profile" and "email"
Scopes
[]
string
`json:"scopes"`
// defaults to "profile" and "email"
// HostedDomains was an optional list of whitelisted domains when using the OIDC connector with Google.
// Only users from a whitelisted domain were allowed to log in.
// Support for this option was removed from the OIDC connector.
// Consider switching to the Google connector which supports this option.
//
// Deprecated: will be removed in future releases.
HostedDomains
[]
string
`json:"hostedDomains"`
// Certificates for SSL validation
// Certificates for SSL validation
RootCAs
[]
string
`json:"rootCAs"`
RootCAs
[]
string
`json:"rootCAs"`
...
@@ -112,6 +120,10 @@ func knownBrokenAuthHeaderProvider(issuerURL string) bool {
...
@@ -112,6 +120,10 @@ func knownBrokenAuthHeaderProvider(issuerURL string) bool {
// Open returns a connector which can be used to login users through an upstream
// Open returns a connector which can be used to login users through an upstream
// OpenID Connect provider.
// OpenID Connect provider.
func
(
c
*
Config
)
Open
(
id
string
,
logger
log
.
Logger
)
(
conn
connector
.
Connector
,
err
error
)
{
func
(
c
*
Config
)
Open
(
id
string
,
logger
log
.
Logger
)
(
conn
connector
.
Connector
,
err
error
)
{
if
len
(
c
.
HostedDomains
)
>
0
{
return
nil
,
fmt
.
Errorf
(
"support for the Hosted domains option had been deprecated and removed, consider switching to the Google connector"
)
}
httpClient
,
err
:=
httpclient
.
NewHTTPClient
(
c
.
RootCAs
,
c
.
InsecureSkipVerify
)
httpClient
,
err
:=
httpclient
.
NewHTTPClient
(
c
.
RootCAs
,
c
.
InsecureSkipVerify
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
...
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