Skip to content

Commit

Permalink
openid: Merge duplicate aud claim values (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
arekkas authored May 29, 2018
1 parent 57b1471 commit 93618d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
name = "github.com/gorilla/mux"
version = "1.5.0"

[[constraint]]
version = "0.0.3"
name = "github.com/ory/go-convenience"

[[constraint]]
branch = "master"
name = "github.com/gtank/cryptopasta"
Expand Down
3 changes: 2 additions & 1 deletion handler/openid/strategy_jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/mohae/deepcopy"
"github.com/ory/fosite"
"github.com/ory/fosite/token/jwt"
"github.com/ory/go-convenience/stringsx"
"github.com/pkg/errors"
)

Expand Down Expand Up @@ -227,7 +228,7 @@ func (h DefaultStrategy) GenerateIDToken(_ context.Context, requester fosite.Req
}

claims.Nonce = nonce
claims.Audience = append(claims.Audience, requester.GetClient().GetID())
claims.Audience = stringsx.Unique(append(claims.Audience, requester.GetClient().GetID()))
claims.IssuedAt = time.Now().UTC()

token, _, err = h.RS256JWTStrategy.Generate(claims.ToMapClaims(), sess.IDTokenHeaders())
Expand Down

0 comments on commit 93618d6

Please sign in to comment.