Ash Wilson | 1f11051 | 2014-10-02 15:43:47 -0400 | [diff] [blame] | 1 | package tokens |
| 2 | |
Jon Perritt | a3302e1 | 2016-03-07 03:48:59 -0600 | [diff] [blame] | 3 | import "fmt" |
Ash Wilson | 1f11051 | 2014-10-02 15:43:47 -0400 | [diff] [blame] | 4 | |
| 5 | var ( |
| 6 | // ErrUserIDProvided is returned if you attempt to authenticate with a UserID. |
| 7 | ErrUserIDProvided = unacceptedAttributeErr("UserID") |
| 8 | |
Ash Wilson | 1cf4d5f | 2014-10-07 14:16:18 -0400 | [diff] [blame] | 9 | // ErrAPIKeyProvided is returned if you attempt to authenticate with an APIKey. |
| 10 | ErrAPIKeyProvided = unacceptedAttributeErr("APIKey") |
| 11 | |
Ash Wilson | 1f11051 | 2014-10-02 15:43:47 -0400 | [diff] [blame] | 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") |
Ash Wilson | 1f11051 | 2014-10-02 15:43:47 -0400 | [diff] [blame] | 17 | ) |
| 18 | |
| 19 | func unacceptedAttributeErr(attribute string) error { |
| 20 | return fmt.Errorf("The base Identity V2 API does not accept authentication by %s", attribute) |
| 21 | } |