Documentation
¶
Index ¶
Constants ¶
View Source
const AppleAuthURL = "https://appleid.apple.com/auth/token" //the auth URL of apple
View Source
const AppleGrantType = "authorization_code" //the grant type of apple auth
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
RedirectURI string //Your RedirectURI config in apple website
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, redirectURI string, keyID string) *AppleConfig
InitAppleConfig init a new Client of this pkg
func (*AppleConfig) CreateCallbackURL ¶
func (a *AppleConfig) CreateCallbackURL(state string) string
CreateCallbackURL create a callback URL for frontend
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) 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.
