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
a5ad5eaf
Commit
a5ad5eaf
authored
4 years ago
by
m.nabokikh
Browse files
Options
Downloads
Patches
Plain Diff
fix: Minor style fixes after merging PKCE implementation
Signed-off-by:
m.nabokikh
<
maksim.nabokikh@flant.com
>
parent
b5519695
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
connector/ldap/ldap.go
+1
-0
1 addition, 0 deletions
connector/ldap/ldap.go
server/handlers.go
+4
-3
4 additions, 3 deletions
server/handlers.go
with
5 additions
and
3 deletions
connector/ldap/ldap.go
+
1
−
0
View file @
a5ad5eaf
...
...
@@ -62,6 +62,7 @@ type UserMatcher struct {
GroupAttr
string
`json:"groupAttr"`
}
// Config holds configuration options for LDAP logins.
type
Config
struct
{
// The host and optional port of the LDAP server. If port isn't supplied, it will be
// guessed based on the TLS configuration. 389 or 636.
...
...
This diff is collapsed.
Click to expand it.
server/handlers.go
+
4
−
3
View file @
a5ad5eaf
...
...
@@ -820,7 +820,8 @@ func (s *Server) handleAuthCode(w http.ResponseWriter, r *http.Request, client s
codeChallengeFromStorage
:=
authCode
.
PKCE
.
CodeChallenge
providedCodeVerifier
:=
r
.
PostFormValue
(
"code_verifier"
)
if
providedCodeVerifier
!=
""
&&
codeChallengeFromStorage
!=
""
{
switch
{
case
providedCodeVerifier
!=
""
&&
codeChallengeFromStorage
!=
""
:
calculatedCodeChallenge
,
err
:=
s
.
calculateCodeChallenge
(
providedCodeVerifier
,
authCode
.
PKCE
.
CodeChallengeMethod
)
if
err
!=
nil
{
s
.
logger
.
Error
(
err
)
...
...
@@ -831,11 +832,11 @@ func (s *Server) handleAuthCode(w http.ResponseWriter, r *http.Request, client s
s
.
tokenErrHelper
(
w
,
errInvalidGrant
,
"Invalid code_verifier."
,
http
.
StatusBadRequest
)
return
}
}
else
if
providedCodeVerifier
!=
""
{
case
providedCodeVerifier
!=
""
:
// Received no code_challenge on /auth, but a code_verifier on /token
s
.
tokenErrHelper
(
w
,
errInvalidRequest
,
"No PKCE flow started. Cannot check code_verifier."
,
http
.
StatusBadRequest
)
return
}
else
if
codeChallengeFromStorage
!=
""
{
case
codeChallengeFromStorage
!=
""
:
// Received PKCE request on /auth, but no code_verifier on /token
s
.
tokenErrHelper
(
w
,
errInvalidGrant
,
"Expecting parameter code_verifier in PKCE flow."
,
http
.
StatusBadRequest
)
return
...
...
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