Skip to content

Commit

Permalink
dont client id for aud
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Brown <ccbrown112@gmail.com>
  • Loading branch information
ccbrown committed Jan 22, 2017
1 parent 6ada567 commit 8e4543b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 11 deletions.
1 change: 0 additions & 1 deletion handler/oauth2/introspector_jwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ func TestIntrospectJWT(t *testing.T) {
assert.True(t, errors.Cause(err) == c.expectErr, "(%d) %s\n%s\n%s", k, c.description, err, c.expectErr)

if err == nil {
assert.Equal(t, "group0", areq.GetClient().GetID())
assert.Equal(t, "peter", areq.Session.GetSubject())
}

Expand Down
8 changes: 1 addition & 7 deletions handler/oauth2/strategy_jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ func (h *RS256JWTStrategy) ValidateJWT(tokenType fosite.TokenType, token string)
claims.FromMapClaims(t.Claims.(jwtx.MapClaims))

requester = &fosite.Request{
Client: &fosite.DefaultClient{
ID: claims.Audience,
},
Client: &fosite.DefaultClient{},
RequestedAt: claims.IssuedAt,
Session: &JWTSession{
JWTClaims: &claims,
Expand Down Expand Up @@ -155,10 +153,6 @@ func (h *RS256JWTStrategy) generate(tokenType fosite.TokenType, requester fosite
claims.Issuer = h.Issuer
}

if claims.Audience == "" {
claims.Audience = requester.GetClient().GetID()
}

claims.Scope = requester.GetGrantedScopes()

return h.RS256JWTStrategy.Generate(claims.ToMapClaims(), jwtSession.GetJWTHeader())
Expand Down
2 changes: 0 additions & 2 deletions handler/oauth2/strategy_jwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ var j = &RS256JWTStrategy{
var jwtValidCase = func(tokenType fosite.TokenType) *fosite.Request {
return &fosite.Request{
Client: &fosite.DefaultClient{
ID: "group0",
Secret: []byte("foobarfoobarfoobarfoobar"),
},
Session: &JWTSession{
Expand Down Expand Up @@ -51,7 +50,6 @@ var jwtValidCase = func(tokenType fosite.TokenType) *fosite.Request {
var jwtExpiredCase = func(tokenType fosite.TokenType) *fosite.Request {
return &fosite.Request{
Client: &fosite.DefaultClient{
ID: "group0",
Secret: []byte("foobarfoobarfoobarfoobar"),
},
Session: &JWTSession{
Expand Down
1 change: 0 additions & 1 deletion integration/introspect_token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func runIntrospectTokenTest(t *testing.T, strategy oauth2.AccessTokenStrategy, i
assert.Len(t, errs, 0)
assert.Equal(t, c.isActive, res.Active)
if c.isActive {
assert.Equal(t, "my-client", res.ClientId)
assert.Equal(t, "fosite", res.Scope)
assert.True(t, res.ExpiresAt > 0)
assert.True(t, res.IssuedAt > 0)
Expand Down

0 comments on commit 8e4543b

Please sign in to comment.