apple

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const APPLE_BASE_URL = "https://appleid.apple.com"
View Source
const JWKS_APPLE_URI = "/auth/keys"

Variables

This section is empty.

Functions

This section is empty.

Types

type AppleKey

type AppleKey struct {
	Kty string `json:"kty"`
	Kid string `json:"kid"`
	Use string `json:"use"`
	Alg string `json:"alg"`
	N   string `json:"n"`
	E   string `json:"e"`
}

key object fetched from APPLE_KEYS_URL

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New() *Client

func (*Client) GetApplePublicKeyObject

func (c *Client) GetApplePublicKeyObject(kid string, alg string) *rsa.PublicKey

locally cache and get apple rsa.PublicKey object

func (*Client) VerifyIdToken

func (c *Client) VerifyIdToken(clientId, idToken string) (*IdTokenResponse, error)

type IdTokenResponse

type IdTokenResponse struct {
	Aud            string `json:"aud"`
	C_hash         string `mapstructure:"c_hash" json:"c_hash"`
	Email          string `json:"email"`
	EmailVerified  string `mapstructure:"email_verified" json:"email_verified"`
	AuthTime       int64  `mapstructure:"auth_time" json:"auth_time"`
	Exp            int64  `json:"exp"`
	Iat            int64  `json:"iat"`
	Iss            string `json:"iss"`
	Nonce          string `json:"nonce"`
	NonceSupported bool   `mapstructure:"nonce_supported" json:"nonce_supported"`
	Sub            string `json:"sub"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL