Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Commit b76a3d6

Browse files
authored
Merge pull request #243 from s1cyan/cryptic
login fix
2 parents 196bc34 + d1eac8c commit b76a3d6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/login.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import (
3030
"github.com/kabanero-io/kabanero-command-line/pkg/security"
3131
"github.com/spf13/cobra"
3232

33+
"encoding/base64"
34+
3335
"github.com/spf13/viper"
3436
"golang.org/x/crypto/ssh/terminal"
3537
)
@@ -186,8 +188,9 @@ var loginCmd = &cobra.Command{
186188
HandleTLSFLag(InsecureTLS)
187189

188190
kabLoginURL = getRESTEndpoint("login")
189-
190-
requestBody, _ := json.Marshal(map[string]string{"gituser": username, "gitpat": password})
191+
ePass := base64.StdEncoding.EncodeToString([]byte(password))
192+
eUser := base64.StdEncoding.EncodeToString([]byte(username))
193+
requestBody, _ := json.Marshal(map[string]string{"000_ERG_TEN_TWENTY": eUser, "010_BOHM_THIRTY_FIVE": ePass})
191194

192195
resp, err := sendHTTPRequest("POST", kabLoginURL, requestBody)
193196
if err != nil {

0 commit comments

Comments
 (0)