// Parse parses a JWT without verifying it's signature.
Parse parses a JWT without verifying it's signature.
// Parse parses a JWT without verifying it ' s signature .
func Parse(token string) (Token, error) {
	var t Token
	parts := strings.Split(token, ".")
	if len(parts) != 3 {
		return t, errors.New("jwt: invalid JWT")
	}
	rawHeader, err := base64Decode(parts[0])
	if err != nil {
		return t, err
	}
	if err := json.Unmarshal([]byte(rawHeader), &t.Header); err != nil {
		return t, err
	}
	rawClaims, err := base64Decode(parts[1])
	if err != nil {
		return t, err
	}
	if err := json.Unmarshal([]byte(rawClaims), &t.ClaimSet); err != nil {
		return t, err
	}
	t.Signature = parts[2]
	return t, nil
}
func Parse ( token string ) ( Token , error ) { var t Token parts := strings . Split ( token , " " ) if len ( parts ) != 3 { return t , errors . New ( " " ) } rawHeader , err := base64Decode ( parts [ 0 ] ) if err != nil { return t , err } if err := json . Unmarshal ( [ ] byte ( rawHeader ) , & t . Header ) ; err != nil { return t , err } rawClaims , err := base64Decode ( parts [ 1 ] ) if err != nil { return t , err } if err := json . Unmarshal ( [ ] byte ( rawClaims ) , & t . ClaimSet ) ; err != nil { return t , err } t . Signature = parts [ 2 ] return t , nil }
Parse parses a JWT without verifying it's signature.
Parse parses a JWT without verifying it ' s signature .