Documentation ¶
Overview ¶
Package appleoauth provides the user/password login to Apple web service.
Index ¶
Constants ¶
View Source
const ( // EnvIcloudUserName is the environment variable for login username to Apple web service. EnvIcloudUserName = "APPLE_USERNAME" // EnvIcloudPassword is the environment variable for login password to Apple web service. EnvIcloudPassword = "APPLE_PASSWORD" Env2FASMSDefaultPhoneNumber = "APPLEOAUTH_2FA_SMS_DEFAULT_PHONE_NUMBER" )
View Source
const ( HdrContentType = "Content-Type" HdrXRequestedWith = "X-Requested-With" HdrXAppleWidgetKey = "X-Apple-Widget-Key" HdrAccept = "Accept" HdrXAppleIDSessionID = "X-Apple-ID-Session-Id" HdrScnt = "scnt" )
View Source
const (
ProtocolVersion = "QH5B2"
)
Variables ¶
View Source
var ( ErrInvalidUsernameOrPassword = errors.New("invalid username and password combination") ErrRequiredPrivacyAck = errors.New("needs to manually sign in to https://appleid.apple.com (or https://appstoreconnect.apple.com) and acknowledge the Apple ID and Privacy agreement") ErrUpgradeTwoFactorAuth = errors.New("this account is being prompted to upgrade to Two-factor authentication") ErrInvalidPhoneNumber = errors.New("not a valid phone number") ErrNoTrustedPhoneNumbers = errors.New("account doesn't have any trusted phone numbers, but they're required for two-factor authentication. see https://support.apple.com/en-ca/HT204915") ErrNotAuthenticated = errors.New("already signed out") ErrUnexpectedSigninResponse = errors.New("unexpected sign in response") ErrTooManyVerificationCodes = errors.New("too many verification codes have been sent") ErrEmpty2FAEnv = fmt.Errorf("%s environment variable is empty", Env2FASMSDefaultPhoneNumber) ErrNotImplemented = errors.New("not implemented") )
View Source
var (
DefaultClient = &http.Client{
Jar: jar,
}
)
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Apple OAuth2 client.
func (*Client) FetchOlympusSession ¶
FetchOlympusSession fetch the "itctx" from the new "olympus" (22nd May 2017) API endpoint.
func (*Client) FetchServiceKey ¶
FetchServiceKey fetch serviceKey to authenticate to Apple's web service from the iTunes Connect endpoint.
type ServiceError ¶
type ServiceError struct { Code string `json:"code,omitempty"` Title string `json:"title,omitempty"` Message string `json:"message,omitempty"` }
ServiceError represents a Apple service error.
func (ServiceError) Error ¶
func (e ServiceError) Error() string
Error returns the string representation of a ServiceError.
Click to show internal directories.
Click to hide internal directories.