func SigningString(t *jwt.Token, body string, b64encoded bool) (string, error) {
	headersJSON, err := json.Marshal(t.Header)
	if err != nil {
		return "", fmt.Errorf("authentication.SigningString: json.Marshal(t.Header) failed: %w", err)
	}
	headers := jwt.EncodeSegment(headersJSON)

	var payload string
	if b64encoded {
		payload = jwt.EncodeSegment([]byte(body))
	} else {
		payload = body
	}

	return strings.Join([]string{headers, payload}, "."), nil
}
// SigningString takes the token, body string and b64 indicator
// if b64encoded=true - base64urlEncodes the payload string as part of the string to be signed
// if b64encoded=false - includes the payload unencoded (unmodified) in the string to be signed
SigningString takes the token, body string and b64 indicator
if b64encoded=true - base64urlEncodes the payload string as part of the string to be signed
if b64encoded=false - includes the payload unencoded (unmodified) in the string to be signed
// SigningString takes the token body string and b64 indicator // if b64encoded = true - base64urlEncodes the payload string as part of the string to be signed // if b64encoded = false - includes the payload unencoded ( unmodified ) in the string to be signed
func SigningString(t *jwt.Token, body string, b64encoded bool) (string, error) {
	headersJSON, err := json.Marshal(t.Header)
	if err != nil {
		return "", fmt.Errorf("authentication.SigningString: json.Marshal(t.Header) failed: %w", err)
	}
	headers := jwt.EncodeSegment(headersJSON)
	var payload string
	if b64encoded {
		payload = jwt.EncodeSegment([]byte(body))
	} else {
		payload = body
	}
	return strings.Join([]string{headers, payload}, "."), nil
}
func SigningString ( t * jwt . Token , body string , b64encoded bool ) ( string , error ) { headersJSON , err := json . Marshal ( t . Header ) if err != nil { return " " , fmt . Errorf ( " " , err ) } headers := jwt . EncodeSegment ( headersJSON ) var payload string if b64encoded { payload = jwt . EncodeSegment ( [ ] byte ( body ) ) } else { payload = body } return strings . Join ( [ ] string { headers , payload } , " " ) , nil }
SigningString takes the token, body string and b64 indicator
if b64encoded=true - base64urlEncodes the payload string as part of the string to be signed
if b64encoded=false - includes the payload unencoded (unmodified) in the string to be signed
SigningString takes the token body string and b64 indicator if b64encoded = true - base64urlEncodes the payload string as part of the string to be signed if b64encoded = false - includes the payload unencoded ( unmodified ) in the string to be signed