blob: 3a9172e0cc79d500453b80ae5450a2ca3e95e7a6 [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
Ash Wilson1cf4d5f2014-10-07 14:16:18 -040012 // ErrAPIKeyProvided is returned if you attempt to authenticate with an APIKey.
13 ErrAPIKeyProvided = unacceptedAttributeErr("APIKey")
14
Ash Wilson1f110512014-10-02 15:43:47 -040015 // 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 Wilson1cf4d5f2014-10-07 14:16:18 -040024 // ErrPasswordRequired is returned if you don't provide a password.
25 ErrPasswordRequired = errors.New("Please supply a Password in your AuthOptions.")
Ash Wilson1f110512014-10-02 15:43:47 -040026)
27
28func unacceptedAttributeErr(attribute string) error {
29 return fmt.Errorf("The base Identity V2 API does not accept authentication by %s", attribute)
30}