From d1eac8c1e1714cf7e6e1f952705fe2110fc9d58c Mon Sep 17 00:00:00 2001 From: Claudia Yan Date: Wed, 27 Jan 2021 11:31:49 -0500 Subject: [PATCH] login fix --- cmd/login.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/login.go b/cmd/login.go index bbb4246..afe4ac6 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -30,6 +30,8 @@ import ( "github.com/kabanero-io/kabanero-command-line/pkg/security" "github.com/spf13/cobra" + "encoding/base64" + "github.com/spf13/viper" "golang.org/x/crypto/ssh/terminal" ) @@ -186,8 +188,9 @@ var loginCmd = &cobra.Command{ HandleTLSFLag(InsecureTLS) kabLoginURL = getRESTEndpoint("login") - - requestBody, _ := json.Marshal(map[string]string{"gituser": username, "gitpat": password}) + ePass := base64.StdEncoding.EncodeToString([]byte(password)) + eUser := base64.StdEncoding.EncodeToString([]byte(username)) + requestBody, _ := json.Marshal(map[string]string{"000_ERG_TEN_TWENTY": eUser, "010_BOHM_THIRTY_FIVE": ePass}) resp, err := sendHTTPRequest("POST", kabLoginURL, requestBody) if err != nil {