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
d7750b1e
Commit
d7750b1e
authored
May 27, 2019
by
Maarten den Braber
Committed by
mdbraber
Jun 05, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix changes
parent
a8d059a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
handlers.go
server/handlers.go
+18
-8
No files found.
server/handlers.go
View file @
d7750b1e
...
...
@@ -171,7 +171,7 @@ func (s *Server) discoveryHandler() (http.HandlerFunc, error) {
Auth
:
s
.
absURL
(
"/auth"
),
Token
:
s
.
absURL
(
"/token"
),
Keys
:
s
.
absURL
(
"/keys"
),
Keys
:
s
.
absURL
(
"/userinfo"
),
UserInfo
:
s
.
absURL
(
"/userinfo"
),
Subjects
:
[]
string
{
"public"
},
IDTokenAlgs
:
[]
string
{
string
(
jose
.
RS256
)},
Scopes
:
[]
string
{
"openid"
,
"email"
,
"groups"
,
"profile"
,
"offline_access"
},
...
...
@@ -566,12 +566,8 @@ func (s *Server) sendCodeResponse(w http.ResponseWriter, r *http.Request, authRe
idToken
string
idTokenExpiry
time
.
Time
i
accessToken
,
err
:=
s
.
newAccessToken
(
client
.
ID
,
authCode
.
Claims
,
authCode
.
Scopes
,
authCode
.
Nonce
,
authCode
.
ConnectorID
)
if
err
!=
nil
{
s
.
logger
.
Errorf
(
"failed to create new access token: %v"
,
err
)
s
.
tokenErrHelper
(
w
,
errServerError
,
""
,
http
.
StatusInternalServerError
)
return
}
// Access token
accessToken
string
)
for
_
,
responseType
:=
range
authReq
.
ResponseTypes
{
...
...
@@ -607,6 +603,14 @@ i accessToken, err := s.newAccessToken(client.ID, authCode.Claims, authCode.Sco
case
responseTypeIDToken
:
implicitOrHybrid
=
true
var
err
error
accessToken
,
err
:=
s
.
newAccessToken
(
authReq
.
ClientID
,
authReq
.
Claims
,
authReq
.
Scopes
,
authReq
.
Nonce
,
authReq
.
ConnectorID
)
if
err
!=
nil
{
s
.
logger
.
Errorf
(
"failed to create new access token: %v"
,
err
)
s
.
tokenErrHelper
(
w
,
errServerError
,
""
,
http
.
StatusInternalServerError
)
return
}
idToken
,
idTokenExpiry
,
err
=
s
.
newIDToken
(
authReq
.
ClientID
,
authReq
.
Claims
,
authReq
.
Scopes
,
authReq
.
Nonce
,
accessToken
,
authReq
.
ConnectorID
)
if
err
!=
nil
{
s
.
logger
.
Errorf
(
"failed to create ID token: %v"
,
err
)
...
...
@@ -728,7 +732,13 @@ func (s *Server) handleAuthCode(w http.ResponseWriter, r *http.Request, client s
return
}
accessToken
:=
storage
.
NewID
()
accessToken
,
err
:=
s
.
newAccessToken
(
client
.
ID
,
authCode
.
Claims
,
authCode
.
Scopes
,
authCode
.
Nonce
,
authCode
.
ConnectorID
)
if
err
!=
nil
{
s
.
logger
.
Errorf
(
"failed to create new access token: %v"
,
err
)
s
.
tokenErrHelper
(
w
,
errServerError
,
""
,
http
.
StatusInternalServerError
)
return
}
idToken
,
expiry
,
err
:=
s
.
newIDToken
(
client
.
ID
,
authCode
.
Claims
,
authCode
.
Scopes
,
authCode
.
Nonce
,
accessToken
,
authCode
.
ConnectorID
)
if
err
!=
nil
{
s
.
logger
.
Errorf
(
"failed to create ID token: %v"
,
err
)
...
...
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