login.go
changeset 128 a5a00fad7a32
parent 125 2bbb72b9ebf6
child 129 0d4544ce7e5e
equal deleted inserted replaced
127:96a7f2432d27 128:a5a00fad7a32
    16 	TokenType   string `json:"token_type"`
    16 	TokenType   string `json:"token_type"`
    17 }
    17 }
    18 
    18 
    19 // LoginBasic does basic user authentication
    19 // LoginBasic does basic user authentication
    20 func (g *Client) LoginBasic(username, password string, scopes []string) error {
    20 func (g *Client) LoginBasic(username, password string, scopes []string) error {
       
    21 	if g == nil {
       
    22 		return fmt.Errorf("use of uninitialized gondole client")
       
    23 	}
       
    24 
    21 	if username == "" {
    25 	if username == "" {
    22 		return fmt.Errorf("missing username")
    26 		return fmt.Errorf("missing username")
    23 	}
    27 	}
    24 	if password == "" {
    28 	if password == "" {
    25 		return fmt.Errorf("missing password")
    29 		return fmt.Errorf("missing password")