Documentation ¶
Index ¶
- Constants
- Variables
- type AdditionalAuthenticateRequest
- type AdditionalAuthenticationNeededError
- type AdditionalBootArgs
- type AppSpecificPassword
- type AuthMeta
- type BootArgs
- type Client
- func (cli *Client) CreateAppSpecificPassword(ctx context.Context, description string) (*CreateAppSpecificPasswordResponse, error)
- func (cli *Client) DeleteAppSpecificPasswords(ctx context.Context, id int) error
- func (cli *Client) EnterPassword(ctx context.Context, password string) (*TwoFactorInfo, error)
- func (cli *Client) EnterUsername(ctx context.Context, username string, rememberMe bool) error
- func (cli *Client) GetAppSpecificPasswords(ctx context.Context) (GetAppSpecificPasswordsResponse, error)
- func (cli *Client) Prepare(ctx context.Context) error
- func (cli *Client) RequestSMS2FA(ctx context.Context, pushMode string, phoneNumID int) error
- func (cli *Client) RerequestTrustedDevice2FA(ctx context.Context) error
- func (cli *Client) Submit2FA(ctx context.Context, code string) (err error)
- func (cli *Client) SubmitStandardAdditionalAuth(ctx context.Context, password string) error
- type CompleteErrorResponse
- type CompleteRequest
- type CompleteResponse
- type CreateAppSpecificPasswordRequest
- type CreateAppSpecificPasswordResponse
- type DirectBootArgs
- type FederateRequest
- type FederateResponse
- type GetAppSpecificPasswordsResponse
- type HashcashParams
- type InitRequest
- type InitResponse
- type PhoneNumberID
- type PhoneNumberVerification
- type RequestPhoneCodeRequest
- type RequestSecurityCodeResponse
- type RerequestSecurityCodeResponse
- type SecurityCodeParams
- type SecurityCodeWrapper
- type SubmitPhoneCodeRequest
- type SubmitPhoneCodeResponse
- type SubmitSecurityCodeResponse
- type SubmitTrustedDeviceCodeRequest
- type TrustedPhoneNumber
- type TwoFactorInfo
- type TwoSVBootArgs
- type URLBag
Constants ¶
View Source
const ( UserAgent = "Mozilla/5.0 (X11; Linux x86_64; rv:120.0) Gecko/20100101 Firefox/120.0" Language = "en-GB" AcceptLanguage = Language + ",en-US;q=0.7,en;q=0.3" TimeZone = "GMT+00:00" TimeZoneName = "Europe/London" )
Constants that depend on the browser and device
View Source
const ( AppleIDBaseURL = "https://appleid.apple.com" APIKey = "cbf64fd6843ee630b463f358ea0b707b" OAuthClientID = "af1139274f266b22b68c2a3e7ad932cb3c0bbe854e13a79af78dcc73136882c3" OAuthRedirectURI = AppleIDBaseURL OAuthResponseType = "code" OAuthResponseMode = "web_message" HdrValFDClientInfoVersion = "1.1" HdrValRequestContext = "ca" HdrValDocumentAccept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8" )
Static constants
View Source
const ( HdrAuthAttributes = "X-Apple-Auth-Attributes" HdrAuthSessionID = "X-Apple-ID-Session-Id" HdrScnt = "scnt" )
Custom header names that are used in multiple places
Variables ¶
View Source
var ErrStandardAdditionalAuthNeeded = &AdditionalAuthenticationNeededError{Type: "STANDARD"}
Functions ¶
This section is empty.
Types ¶
type AdditionalAuthenticateRequest ¶
type AdditionalAuthenticateRequest struct {
Password string `json:"password"`
}
type AdditionalAuthenticationNeededError ¶
type AdditionalAuthenticationNeededError struct { Type string `json:"type"` FormattedAccountName string `json:"formattedAccountName"` }
func (*AdditionalAuthenticationNeededError) Error ¶
func (err *AdditionalAuthenticationNeededError) Error() string
func (*AdditionalAuthenticationNeededError) Is ¶
func (err *AdditionalAuthenticationNeededError) Is(target error) bool
type AdditionalBootArgs ¶
type AdditionalBootArgs struct {
CanRoute2SV bool `json:"canRoute2sv"`
}
type AppSpecificPassword ¶
type AuthMeta ¶
type AuthMeta struct { FutureReservedAuthUIModes []string `json:"futureReservedAuthUIModes"` SupportedAuthUIModes []string `json:"supportedAuthUIModes"` FEConfiguration struct { PmrpcTimeout string `json:"pmrpcTimeout"` EnableAllowAttribute bool `json:"enableAllowAttribute"` EnableSwpAuth bool `json:"enableSwpAuth"` IsEyebrowTextboxEnabled bool `json:"isEyebrowTextboxEnabled"` SkVersion string `json:"skVersion"` PmrpcRetryCount string `json:"pmrpcRetryCount"` JSLogLevel string `json:"jsLogLevel"` AppLoadDelay string `json:"appLoadDelay"` EnablePerformanceLog bool `json:"enablePerformanceLog"` } `json:"FEConfiguration"` }
type BootArgs ¶
type BootArgs struct { Direct DirectBootArgs `json:"direct"` Additional AdditionalBootArgs `json:"additional"` }
type Client ¶
type Client struct { HTTP http.Client SCNT map[string]string SRP *srp6apple.SRPClient AuthID string AuthSessionID string AuthAttributes []byte HashcashParams *HashcashParams RememberMe bool Username string InitResp *InitResponse SMSRequestedFrom int SMSRequestedMode string }
func (*Client) CreateAppSpecificPassword ¶
func (*Client) DeleteAppSpecificPasswords ¶
func (*Client) EnterPassword ¶
func (*Client) EnterUsername ¶
func (*Client) GetAppSpecificPasswords ¶
func (cli *Client) GetAppSpecificPasswords(ctx context.Context) (GetAppSpecificPasswordsResponse, error)
func (*Client) RequestSMS2FA ¶
func (*Client) RerequestTrustedDevice2FA ¶
type CompleteErrorResponse ¶
type CompleteRequest ¶
type CompleteResponse ¶
type CompleteResponse struct {
AuthType string `json:"authType"`
}
type CreateAppSpecificPasswordRequest ¶
type CreateAppSpecificPasswordRequest struct {
Description string `json:"description"`
}
type CreateAppSpecificPasswordResponse ¶
type CreateAppSpecificPasswordResponse struct { AppSpecificPassword Password string `json:"password"` }
type DirectBootArgs ¶
type DirectBootArgs struct { // Shared ScriptSk7URL string `json:"scriptSk7Url"` // Only initial login IsPasswordSecondStep bool `json:"isPasswordSecondStep"` IsFederatedAuthEnabled bool `json:"isFederatedAuthEnabled"` AccountNameAutoComplete string `json:"accountNameAutoComplete"` AccountName string `json:"accountName"` URLBag URLBag `json:"urlBag"` RefererURL string `json:"refererUrl"` AuthAttributes []byte `json:"authAttributes"` IsRaFF bool `json:"isRaFF"` ForgotPassword bool `json:"forgotPassword"` SwpAuth bool `json:"swpAuth"` TwoFactorAuthEnv int `json:"twoFactorAuthEnv"` CountryCode string `json:"countryCode"` IsInterstitialFedAuthPageEnabled bool `json:"isInterstitialFedAuthPageEnabled"` TwoFactorAuthAppKey []byte `json:"twoFactorAuthAppKey"` IsRTL string `json:"isRtl"` Hashcash HashcashParams `json:"hashcash"` WebSRPClientWorkerScriptTag string `json:"webSRPClientWorkerScriptTag"` IsRaIDP bool `json:"isRaIdp"` AcURL string `json:"acUrl"` EnableSRPAuth bool `json:"enableSRPAuth"` DomainID int `json:"domainId"` ShouldSuppressIForgotLink bool `json:"shouldSuppressIForgotLink"` DisableChromeAutoComplete bool `json:"disableChromeAutoComplete"` GenerateHashcashScriptTag string `json:"generateHashcashScriptTag"` IframeID string `json:"iframeId"` Meta AuthMeta `json:"meta"` EnableFPN bool `json:"enableFpn"` EnableSecurityKeyIndividual bool `json:"enableSecurityKeyIndividual"` ShowSwpAuth bool `json:"showSwpAuth"` // Only two-factor ScriptURL string `json:"scriptUrl"` Module string `json:"module"` IsReact bool `json:"isReact"` AuthUserType string `json:"authUserType"` HasTrustedDevices bool `json:"hasTrustedDevices"` TwoSV TwoSVBootArgs `json:"twoSV"` ReferrerQuery string `json:"referrerQuery"` URLContext string `json:"urlContext"` Tag string `json:"tag"` AuthType string `json:"authType"` AuthInitialRoute string `json:"authInitialRoute"` AppleIDURL string `json:"appleIDUrl"` }
type FederateRequest ¶
type FederateResponse ¶
type GetAppSpecificPasswordsResponse ¶
type GetAppSpecificPasswordsResponse []*AppSpecificPassword
type HashcashParams ¶
type HashcashParams struct { GenerationTimeout int `json:"hashcashGenerationTimeout"` Challenge string `json:"hcChallenge"` Bits int `json:"hcBits,string"` IsStrictTimeout bool `json:"isHCstrictTimeout"` }
func (*HashcashParams) Compute ¶
func (hp *HashcashParams) Compute() string
type InitRequest ¶
type InitResponse ¶
type PhoneNumberID ¶
type PhoneNumberID struct {
ID int `json:"id"`
}
type PhoneNumberVerification ¶
type PhoneNumberVerification struct { TrustedPhoneNumbers []TrustedPhoneNumber `json:"trustedPhoneNumbers"` PhoneNumber TrustedPhoneNumber `json:"phoneNumber"` SecurityCode SecurityCodeParams `json:"securityCode"` AuthenticationType string `json:"authenticationType"` RecoveryURL string `json:"recoveryUrl"` CantUsePhoneNumberURL string `json:"cantUsePhoneNumberUrl"` RecoveryWebURL string `json:"recoveryWebUrl"` RepairPhoneNumberURL string `json:"repairPhoneNumberUrl"` RepairPhoneNumberWebURL string `json:"repairPhoneNumberWebUrl"` AboutTwoFactorAuthenticationURL string `json:"aboutTwoFactorAuthenticationUrl"` TwoFactorVerificationSupportURL string `json:"twoFactorVerificationSupportUrl"` HasRecoveryKey bool `json:"hasRecoveryKey"` SupportsRecoveryKey bool `json:"supportsRecoveryKey"` AutoVerified bool `json:"autoVerified"` ShowAutoVerificationUI bool `json:"showAutoVerificationUI"` SupportsCustodianRecovery bool `json:"supportsCustodianRecovery"` HideSendSMSCodeOption bool `json:"hideSendSMSCodeOption"` SupervisedChangePasswordFlow bool `json:"supervisedChangePasswordFlow"` SupportsRecovery bool `json:"supportsRecovery"` TrustedPhoneNumber TrustedPhoneNumber `json:"trustedPhoneNumber"` Hsa2Account bool `json:"hsa2Account"` RestrictedAccount bool `json:"restrictedAccount"` ManagedAccount bool `json:"managedAccount"` }
type RequestPhoneCodeRequest ¶
type RequestPhoneCodeRequest struct { Mode string `json:"mode"` PhoneNumber PhoneNumberID `json:"phoneNumber"` }
type RequestSecurityCodeResponse ¶
type RequestSecurityCodeResponse struct{}
type RerequestSecurityCodeResponse ¶
type RerequestSecurityCodeResponse struct { TrustedDeviceCount int `json:"trustedDeviceCount"` SecurityCode SecurityCodeParams `json:"securityCode"` PhoneNumberVerification PhoneNumberVerification `json:"phoneNumberVerification"` AboutTwoFactorAuthenticationURL string `json:"aboutTwoFactorAuthenticationUrl"` }
type SecurityCodeParams ¶
type SecurityCodeParams struct { Length int `json:"length"` TooManyCodesSent bool `json:"tooManyCodesSent"` TooManyCodesValidated bool `json:"tooManyCodesValidated"` SecurityCodeLocked bool `json:"securityCodeLocked"` SecurityCodeCooldown bool `json:"securityCodeCooldown"` // Only for submit Valid bool `json:"valid"` }
type SecurityCodeWrapper ¶
type SecurityCodeWrapper struct {
Code string `json:"code"`
}
type SubmitPhoneCodeRequest ¶
type SubmitPhoneCodeRequest struct { PhoneNumber PhoneNumberID `json:"phoneNumber"` SecurityCode SecurityCodeWrapper `json:"securityCode"` Mode string `json:"mode"` }
type SubmitPhoneCodeResponse ¶
type SubmitPhoneCodeResponse struct { TrustedPhoneNumbers []TrustedPhoneNumber `json:"trustedPhoneNumbers"` PhoneNumber TrustedPhoneNumber `json:"phoneNumber"` SecurityCode SecurityCodeParams `json:"securityCode"` Mode string `json:"mode"` Type string `json:"type"` AuthenticationType string `json:"authenticationType"` RecoveryUrl string `json:"recoveryUrl"` CantUsePhoneNumberUrl string `json:"cantUsePhoneNumberUrl"` RecoveryWebUrl string `json:"recoveryWebUrl"` RepairPhoneNumberUrl string `json:"repairPhoneNumberUrl"` RepairPhoneNumberWebUrl string `json:"repairPhoneNumberWebUrl"` AboutTwoFactorAuthenticationUrl string `json:"aboutTwoFactorAuthenticationUrl"` AutoVerified bool `json:"autoVerified"` ShowAutoVerificationUI bool `json:"showAutoVerificationUI"` SupportsCustodianRecovery bool `json:"supportsCustodianRecovery"` HideSendSMSCodeOption bool `json:"hideSendSMSCodeOption"` SupervisedChangePasswordFlow bool `json:"supervisedChangePasswordFlow"` SupportsRecovery bool `json:"supportsRecovery"` TrustedPhoneNumber TrustedPhoneNumber `json:"trustedPhoneNumber"` Hsa2Account bool `json:"hsa2Account"` RestrictedAccount bool `json:"restrictedAccount"` ManagedAccount bool `json:"managedAccount"` }
type SubmitSecurityCodeResponse ¶
type SubmitSecurityCodeResponse struct{}
type SubmitTrustedDeviceCodeRequest ¶
type SubmitTrustedDeviceCodeRequest struct {
SecurityCode SecurityCodeWrapper `json:"securityCode"`
}
type TrustedPhoneNumber ¶
type TwoFactorInfo ¶
type TwoFactorInfo struct { HasTrustedDevices bool PhoneNumberInfo PhoneNumberVerification }
type TwoSVBootArgs ¶
type TwoSVBootArgs struct { SupportedPushModes []string `json:"supportedPushModes"` PhoneNumberVerification PhoneNumberVerification `json:"phoneNumberVerification"` AuthFactors []string `json:"authFactors"` SourceReturnURL string `json:"source_returnurl"` SourceAppID int `json:"sourceAppId"` }
Click to show internal directories.
Click to hide internal directories.