blob: 244db1b42b87a88742627b5722fdcacc55837ce7 [file] [log] [blame]
Ash Wilson1f110512014-10-02 15:43:47 -04001package tokens
2
3import (
4 "errors"
5 "fmt"
6)
7
8var (
9 // ErrUserIDProvided is returned if you attempt to authenticate with a UserID.
10 ErrUserIDProvided = unacceptedAttributeErr("UserID")
11
12 // ErrDomainIDProvided is returned if you attempt to authenticate with a DomainID.
13 ErrDomainIDProvided = unacceptedAttributeErr("DomainID")
14
15 // ErrDomainNameProvided is returned if you attempt to authenticate with a DomainName.
16 ErrDomainNameProvided = unacceptedAttributeErr("DomainName")
17
18 // ErrUsernameRequired is returned if you attempt ot authenticate without a Username.
19 ErrUsernameRequired = errors.New("You must supply a Username in your AuthOptions.")
20
21 // ErrPasswordOrAPIKey is returned if you provide both a password and an API key.
22 ErrPasswordOrAPIKey = errors.New("Please supply exactly one of Password or APIKey in your AuthOptions.")
23)
24
25func unacceptedAttributeErr(attribute string) error {
26 return fmt.Errorf("The base Identity V2 API does not accept authentication by %s", attribute)
27}