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

Method Parse

parser.go:46–48  ·  view source on GitHub ↗

Parse parses, validates, verifies the signature and returns the parsed token. keyFunc will receive the parsed token and should return the key for validating.

(tokenString string, keyFunc Keyfunc)

Source from the content-addressed store, hash-verified

44// Parse parses, validates, verifies the signature and returns the parsed token.
45// keyFunc will receive the parsed token and should return the key for validating.
46func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
47 return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc)
48}
49
50// ParseWithClaims parses, validates, and verifies like Parse, but supplies a default object implementing the Claims
51// interface. This provides default values which can be overridden and allows a caller to use their own type, rather

Callers 5

ExampleParse_hmacFunction · 0.80
ParseFunction · 0.80
mainFunction · 0.80
verifyTokenFunction · 0.80

Calls 1

ParseWithClaimsMethod · 0.95

Tested by 2

ExampleParse_hmacFunction · 0.64