Skip to content

Commit

Permalink
handle LDAP login
Browse files Browse the repository at this point in the history
  • Loading branch information
slntopp committed Jul 5, 2022
1 parent 4d13dcc commit e4eea1f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,17 @@ var loginCmd = &cobra.Command{
}

client := pb.NewAccountsServiceClient(conn)

t := "standard"
if ok, err := cmd.Flags().GetBool("ldap"); err != nil {
return err
} else if ok {
t = "ldap"
}

req := &pb.TokenRequest{
Auth: &accpb.Credentials{
Type: "standard", Data: []string{args[1], args[2]},
Type: t, Data: []string{args[1], args[2]},
},
}

Expand Down Expand Up @@ -132,6 +140,7 @@ var versionCmd = &cobra.Command{
func init() {
loginCmd.Flags().Bool("print-token", false, "")
loginCmd.Flags().Bool("insecure", false, "Use WithInsecure instead of TLS")
loginCmd.Flags().Bool("ldap", false, "Use Credentials Type LDAP")

rootCmd.AddCommand(contextCmd)
rootCmd.AddCommand(loginCmd)
Expand Down

0 comments on commit e4eea1f

Please sign in to comment.