From 8a05cdde52d1b4d36a95f05595570bda37ca23d9 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Mon, 18 Mar 2019 10:59:36 -0700 Subject: [PATCH] Add audience in the error v2 --- authority/authorize.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/authority/authorize.go b/authority/authorize.go index 9f2823e5..d0d04121 100644 --- a/authority/authorize.go +++ b/authority/authorize.go @@ -3,6 +3,7 @@ package authority import ( "crypto/x509" "net/http" + "strings" "time" "github.com/pkg/errors" @@ -55,7 +56,8 @@ func (a *Authority) Authorize(ott string) ([]provisioner.SignOption, error) { // This method will also validate the audiences for JWK provisioners. p, ok := a.provisioners.LoadByToken(token, &claims.Claims) if !ok { - return nil, &apiError{errors.Errorf("authorize: provisioner not found or invalid audience %s", claims.Audience), + return nil, &apiError{ + errors.Errorf("authorize: provisioner not found or invalid audience (%s)", strings.Join(claims.Audience, ", ")), http.StatusUnauthorized, errContext} }