Skip to content

Commit

Permalink
oauth2: Add and enhance access/refresh token tests
Browse files Browse the repository at this point in the history
This patch introduces more tests for code and refresh flows and the JWT
strategy.

Signed-off-by: arekkas <aeneas@ory.am>
  • Loading branch information
arekkas committed Jul 23, 2018
1 parent d3b4e77 commit 7855b33
Show file tree
Hide file tree
Showing 5 changed files with 934 additions and 693 deletions.
3 changes: 0 additions & 3 deletions oauth2/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
"github.com/ory/hydra/client"
"github.com/ory/hydra/consent"
"github.com/ory/hydra/pkg"
"github.com/pborman/uuid"
"github.com/pkg/errors"
)

Expand Down Expand Up @@ -487,7 +486,6 @@ func (h *Handler) TokenHandler(w http.ResponseWriter, r *http.Request, _ httprou

session.Subject = accessRequest.GetClient().GetID()
session.ClientID = accessRequest.GetClient().GetID()
session.JTI = uuid.New()
session.KID = accessTokenKeyID
session.DefaultSession.Claims.Issuer = strings.TrimRight(h.IssuerURL, "/") + "/"
session.DefaultSession.Claims.IssuedAt = time.Now().UTC()
Expand Down Expand Up @@ -591,7 +589,6 @@ func (h *Handler) AuthHandler(w http.ResponseWriter, r *http.Request, _ httprout
Extra: session.Session.AccessToken,
// Here, we do not include the client because it's typically not the audience.
Audience: []string{},
JTI: uuid.New(),
KID: accessTokenKeyID,
ClientID: authorizeRequest.GetClient().GetID(),
})
Expand Down
Loading

0 comments on commit 7855b33

Please sign in to comment.