Documentation ¶
Index ¶
Constants ¶
View Source
const ( AppleAuthURL = "https://appleid.apple.com/auth/token" //the auth URL of apple AppleGrantType = "authorization_code" //the grant type of apple auth AUDLink = "https://appleid.apple.com" //aud field )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppleAuthToken ¶
type AppleAuthToken struct { AccessToken string `json:"access_token"` //AccessToken ExpiresIn int64 `json:"expires_in"` //Expires in IDToken string `json:"id_token"` //ID token RefreshToken string `json:"refresh_token"` //RF token TokenType string `json:"token_type"` //Token Type }
AppleAuthToken main response of apple REST-API
type AppleConfig ¶
type AppleConfig struct { TeamID string //Your Apple Team ID ClientID string //Your Service which enable sign-in-with-apple service KeyID string //Your Secret Key ID AESCert interface{} //Your Secret Key Created By X509 package }
AppleConfig Main struct of the package
func InitAppleConfig ¶
func InitAppleConfig(teamID string, clientID string, keyID string) *AppleConfig
InitAppleConfig init a new Client of this pkg
func (*AppleConfig) GetAppleToken ¶
func (a *AppleConfig) GetAppleToken(code string, expireTime int64) (*AppleAuthToken, error)
input your code and expire-time to get AccessToken of apple
func (*AppleConfig) GetUserByToken ¶
func (a *AppleConfig) GetUserByToken(token string) (*AppleUser, error)
func (*AppleConfig) LoadP8CertByByte ¶
func (a *AppleConfig) LoadP8CertByByte(str []byte) (err error)
LoadP8CertByByte use x509.ParsePKCS8PrivateKey to Parse cert file
func (*AppleConfig) LoadP8CertByFile ¶
func (a *AppleConfig) LoadP8CertByFile(path string) (err error)
LoadP8CertByFile load file and Parse it
Click to show internal directories.
Click to hide internal directories.