// used to decode the JWT payload, and return the value from the usernameClaim
used to decode the JWT payload, and return the value from the usernameClaim
// used to decode the JWT payload and return the value from the usernameClaim
func DecodeAndReturnUsernameClaim(jwt string, usernameClaim string) string {
	tokenParts := strings.Split(jwt, ".")
	tokenPayloadBytes, _ := base64.StdEncoding.DecodeString(tokenParts[1])
	tokenPayloadText := string(tokenPayloadBytes)
	tokenUsernameClaimPos := strings.Index(tokenPayloadText, "\""+usernameClaim+"\"")
	tokenUsernameClaimEndPos := strings.Index(tokenPayloadText[tokenUsernameClaimPos:], "\",\"")
	return tokenPayloadText[tokenUsernameClaimPos+len(usernameClaim)+4 : tokenUsernameClaimPos+tokenUsernameClaimEndPos]
}
func DecodeAndReturnUsernameClaim ( jwt string , usernameClaim string ) string { tokenParts := strings . Split ( jwt , " " ) tokenPayloadBytes , _ := base64 . StdEncoding . DecodeString ( tokenParts [ 1 ] ) tokenPayloadText := string ( tokenPayloadBytes ) tokenUsernameClaimPos := strings . Index ( tokenPayloadText , " \" " + usernameClaim + " \" " ) tokenUsernameClaimEndPos := strings . Index ( tokenPayloadText [ tokenUsernameClaimPos : ] , " \" \" " ) return tokenPayloadText [ tokenUsernameClaimPos + len ( usernameClaim ) + 4 : tokenUsernameClaimPos + tokenUsernameClaimEndPos ] }
used to decode the JWT payload, and return the value from the usernameClaim
used to decode the JWT payload and return the value from the usernameClaim