MCPcopy
hub / github.com/golang-jwt/jwt / verifyIssuer

Method verifyIssuer

validator.go:279–290  ·  validator.go::Validator.verifyIssuer

verifyIssuer compares the iss claim in claims against cmp. If iss is not set, it will succeed if the claim is not required, otherwise ErrTokenRequiredClaimMissing will be returned. Additionally, if any error occurs while retrieving the claim, e.g., when its the wrong type, an ErrTokenUnverifiable

(claims Claims, cmp string, required bool)

Source from the content-addressed store, hash-verified

277// Additionally, if any error occurs while retrieving the claim, e.g., when its
278// the wrong type, an ErrTokenUnverifiable error will be returned.
279func (v *Validator) verifyIssuer(claims Claims, cmp string, required bool) error {
280 iss, err := claims.GetIssuer()
281 if err != nil {
282 return err
283 }
284
285 if iss == "" {
286 return errorIfRequired(required, "iss")
287 }
288
289 return errorIfFalse(iss == cmp, ErrTokenInvalidIssuer)
290}
291
292// verifySubject compares the sub claim against cmp.
293//

Callers 2

ValidateMethod · 0.95

Calls 3

errorIfRequiredFunction · 0.85
errorIfFalseFunction · 0.85
GetIssuerMethod · 0.65

Tested by 1