Skip to content

Commit

Permalink
remove nonce from default Request Object params
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardsn committed May 17, 2024
1 parent c379bdb commit a998291
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 0 additions & 2 deletions auth/api/iam/jar.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ func createJarRequest(client did.DID, server *did.DID, modifier requestObjectMod
params := map[string]string{
jwt.IssuerKey: client.String(),
oauth.ClientIDParam: client.String(),
// added by default, can be overriden by the caller
oauth.NonceParam: cryptoNuts.GenerateNonce(),
}
if server != nil {
requestURIMethod = "get"
Expand Down
6 changes: 2 additions & 4 deletions auth/api/iam/jar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,11 @@ func TestJar_Create(t *testing.T) {
req := jar{}.Create(verifierDID, &holderDID, modifier)
assert.Equal(t, "get", req.RequestURIMethod)
assert.Equal(t, verifierDID, req.Client)
assert.Len(t, req.Claims, 5)
assert.Len(t, req.Claims, 4)
assert.Equal(t, req.Claims[oauth.ClientIDParam], verifierDID.String())
assert.Equal(t, req.Claims[jwt.IssuerKey], verifierDID.String())
assert.Equal(t, req.Claims[jwt.AudienceKey], holderDID.String())
assert.Equal(t, req.Claims["requestObjectModifier"], "works")
assert.NotEmpty(t, req.Claims[oauth.NonceParam])
})
t.Run("request_uri_method=post", func(t *testing.T) {
modifier := func(claims map[string]string) {
Expand All @@ -60,11 +59,10 @@ func TestJar_Create(t *testing.T) {
req := jar{}.Create(verifierDID, nil, modifier)
assert.Equal(t, "post", req.RequestURIMethod)
assert.Equal(t, verifierDID, req.Client)
assert.Len(t, req.Claims, 3)
assert.Len(t, req.Claims, 2)
assert.Equal(t, req.Claims[jwt.IssuerKey], holderDID.String())
assert.Equal(t, req.Claims[oauth.ClientIDParam], verifierDID.String())
assert.Empty(t, req.Claims[jwt.AudienceKey])
assert.NotEmpty(t, req.Claims[oauth.NonceParam])
})
}
func TestJar_Sign(t *testing.T) {
Expand Down

0 comments on commit a998291

Please sign in to comment.