func GenerateToken(identityID string, identityUsername string, privateKey *rsa.PrivateKey) (string, error) {
	token := jwt.New(jwt.SigningMethodRS256)
	token.Claims.(jwt.MapClaims)["uuid"] = identityID
	token.Claims.(jwt.MapClaims)["preferred_username"] = identityUsername
	token.Claims.(jwt.MapClaims)["sub"] = identityID

	tokenStr, err := token.SignedString(privateKey)
	if err != nil {
		return "", errors.WithStack(err)
	}
	return tokenStr, nil
}
// GenerateToken generates a JWT token and signs it using the given private key
GenerateToken generates a JWT token and signs it using the given private key
// GenerateToken generates a JWT token and signs it using the given private key
func GenerateToken(identityID string, identityUsername string, privateKey *rsa.PrivateKey) (string, error) {
	token := jwt.New(jwt.SigningMethodRS256)
	token.Claims.(jwt.MapClaims)["uuid"] = identityID
	token.Claims.(jwt.MapClaims)["preferred_username"] = identityUsername
	token.Claims.(jwt.MapClaims)["sub"] = identityID
	tokenStr, err := token.SignedString(privateKey)
	if err != nil {
		return "", errors.WithStack(err)
	}
	return tokenStr, nil
}
func GenerateToken ( identityID string , identityUsername string , privateKey * rsa . PrivateKey ) ( string , error ) { token := jwt . New ( jwt . SigningMethodRS256 ) token . Claims . ( jwt . MapClaims ) [ " " ] = identityID token . Claims . ( jwt . MapClaims ) [ " " ] = identityUsername token . Claims . ( jwt . MapClaims ) [ " " ] = identityID tokenStr , err := token . SignedString ( privateKey ) if err != nil { return " " , errors . WithStack ( err ) } return tokenStr , nil }
GenerateToken generates a JWT token and signs it using the given private key
GenerateToken generates a JWT token and signs it using the given private key