Ash Wilson | 1f11051 | 2014-10-02 15:43:47 -0400 | [diff] [blame] | 1 | package tokens |
| 2 | |
| 3 | import ( |
| 4 | "errors" |
| 5 | "fmt" |
| 6 | ) |
| 7 | |
| 8 | var ( |
| 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 | |
| 25 | func unacceptedAttributeErr(attribute string) error { |
| 26 | return fmt.Errorf("The base Identity V2 API does not accept authentication by %s", attribute) |
| 27 | } |