func idsFromJWT(jwtContent string) (uid string, sid string, tokenID string, err error) {
	parts := strings.Split(jwtContent, ".")
	if len(parts) != 3 {
		return "", "", "", fmt.Errorf("JWT must have 3 '.'-separated parts, but had %d: %q", len(parts), jwtContent)
	}
	bytes, err := base64.RawURLEncoding.DecodeString(parts[1])
	if err != nil {
		return "", "", "", fmt.Errorf("failed to decode JWT content %q as Base64 URL-encoded string: %v", parts[1], err)
	}

	var jsonMap map[string]interface{}
	if err := json.Unmarshal(bytes, &jsonMap); err != nil {
		return "", "", "", fmt.Errorf("failed to decode JWT content %s as JSON: %v", string(bytes), err)
	}

	// "sub" = "subject" field, which is used as the UID
	uid = getMapUUIDStringVal(jsonMap, "sub")
	// "sid" is used to store the session ID
	sid = getMapUUIDStringVal(jsonMap, "sid")
	// "jti" is used to store the token ID
	tokenID = getMapUUIDStringVal(jsonMap, "jti")

	return uid, sid, tokenID, nil
}
// idsFromJWT returns the uid, sid and tokenID in the provided JWT. Note that signature verification is not performed on
// the JWT, so the returned values should not be considered secure or used for security purposes. However, the values
// are considered acceptable for use in logging.
idsFromJWT returns the uid, sid and tokenID in the provided JWT. Note that signature verification is not performed on
the JWT, so the returned values should not be considered secure or used for security purposes. However, the values
are considered acceptable for use in logging.
// idsFromJWT returns the uid sid and tokenID in the provided JWT . Note that signature verification is not performed on // the JWT so the returned values should not be considered secure or used for security purposes . However the values // are considered acceptable for use in logging .
func idsFromJWT(jwtContent string) (uid string, sid string, tokenID string, err error) {
	parts := strings.Split(jwtContent, ".")
	if len(parts) != 3 {
		return "", "", "", fmt.Errorf("JWT must have 3 '.'-separated parts, but had %d: %q", len(parts), jwtContent)
	}
	bytes, err := base64.RawURLEncoding.DecodeString(parts[1])
	if err != nil {
		return "", "", "", fmt.Errorf("failed to decode JWT content %q as Base64 URL-encoded string: %v", parts[1], err)
	}
	var jsonMap map[string]interface{}
	if err := json.Unmarshal(bytes, &jsonMap); err != nil {
		return "", "", "", fmt.Errorf("failed to decode JWT content %s as JSON: %v", string(bytes), err)
	}
	uid = getMapUUIDStringVal(jsonMap, "sub")
	sid = getMapUUIDStringVal(jsonMap, "sid")
	tokenID = getMapUUIDStringVal(jsonMap, "jti")
	return uid, sid, tokenID, nil
}
func idsFromJWT ( jwtContent string ) ( uid string , sid string , tokenID string , err error ) { parts := strings . Split ( jwtContent , " " ) if len ( parts ) != 3 { return " " , " " , " " , fmt . Errorf ( " " , len ( parts ) , jwtContent ) } bytes , err := base64 . RawURLEncoding . DecodeString ( parts [ 1 ] ) if err != nil { return " " , " " , " " , fmt . Errorf ( " " , parts [ 1 ] , err ) } var jsonMap map [ string ] interface { } if err := json . Unmarshal ( bytes , & jsonMap ) ; err != nil { return " " , " " , " " , fmt . Errorf ( " " , string ( bytes ) , err ) } uid = getMapUUIDStringVal ( jsonMap , " " ) sid = getMapUUIDStringVal ( jsonMap , " " ) tokenID = getMapUUIDStringVal ( jsonMap , " " ) return uid , sid , tokenID , nil }
idsFromJWT returns the uid, sid and tokenID in the provided JWT.
idsFromJWT returns the uid sid and tokenID in the provided JWT .
// "sub" = "subject" field, which is used as the UID // "sid" is used to store the session ID // "jti" is used to store the token ID