Skip to content

Commit

Permalink
Forwarding jti in the challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
janekolszak committed Dec 31, 2016
1 parent d4d9b42 commit c1a84d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions challenge.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ type Challenge struct {
// Time of expiration
Expires time.Time

// Unique JWT id
JTI string

// Redirect URL
Redirect string

Expand Down Expand Up @@ -99,6 +102,7 @@ func (c *Challenge) GrantAccessToAll(w http.ResponseWriter, r *http.Request) err
claims["exp"] = now.Add(time.Minute * 4).Unix()
claims["iat"] = now.Unix()
claims["scp"] = c.Scopes
claims["jti"] = c.JTI
claims["sub"] = c.User

// Sign and get the complete encoded token as a string
Expand Down
1 change: 1 addition & 0 deletions idp.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ func (idp *IDP) NewChallenge(r *http.Request, user string) (challenge *Challenge
}

challenge.Redirect = claims["redir"].(string)
challenge.JTI = claims["jti"].(string)
challenge.User = user
challenge.idp = idp

Expand Down

0 comments on commit c1a84d4

Please sign in to comment.