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 | |
Ash Wilson | 1cf4d5f | 2014-10-07 14:16:18 -0400 | [diff] [blame] | 12 | // ErrAPIKeyProvided is returned if you attempt to authenticate with an APIKey. |
| 13 | ErrAPIKeyProvided = unacceptedAttributeErr("APIKey") |
| 14 | |
Ash Wilson | 1f11051 | 2014-10-02 15:43:47 -0400 | [diff] [blame] | 15 | // ErrDomainIDProvided is returned if you attempt to authenticate with a DomainID. |
| 16 | ErrDomainIDProvided = unacceptedAttributeErr("DomainID") |
| 17 | |
| 18 | // ErrDomainNameProvided is returned if you attempt to authenticate with a DomainName. |
| 19 | ErrDomainNameProvided = unacceptedAttributeErr("DomainName") |
| 20 | |
| 21 | // ErrUsernameRequired is returned if you attempt ot authenticate without a Username. |
| 22 | ErrUsernameRequired = errors.New("You must supply a Username in your AuthOptions.") |
| 23 | |
Ash Wilson | 1cf4d5f | 2014-10-07 14:16:18 -0400 | [diff] [blame] | 24 | // ErrPasswordRequired is returned if you don't provide a password. |
| 25 | ErrPasswordRequired = errors.New("Please supply a Password in your AuthOptions.") |
Ash Wilson | 1f11051 | 2014-10-02 15:43:47 -0400 | [diff] [blame] | 26 | ) |
| 27 | |
| 28 | func unacceptedAttributeErr(attribute string) error { |
| 29 | return fmt.Errorf("The base Identity V2 API does not accept authentication by %s", attribute) |
| 30 | } |