From 433a28584daa20d8d2854758a2ba1a9ae2e259aa Mon Sep 17 00:00:00 2001 From: Tobias Fonfara Date: Tue, 23 Nov 2021 18:17:42 +0100 Subject: [PATCH] #129: Added VerifyIssuer method to RegisteredClaims --- claims.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/claims.go b/claims.go index 444e8599..41cc8265 100644 --- a/claims.go +++ b/claims.go @@ -113,6 +113,12 @@ func (c *RegisteredClaims) VerifyNotBefore(cmp time.Time, req bool) bool { return verifyNbf(&c.NotBefore.Time, cmp, req) } +// VerifyIssuer compares the iss claim against cmp. +// If required is false, this method will return true if the value matches or is unset +func (c *RegisteredClaims) VerifyIssuer(cmp string, req bool) bool { + return verifyIss(c.Issuer, cmp, req) +} + // StandardClaims are a structured version of the JWT Claims Set, as referenced at // https://datatracker.ietf.org/doc/html/rfc7519#section-4. They do not follow the // specification exactly, since they were based on an earlier draft of the