Documentation
¶
Index ¶
- type Client
- func (c *Client) CheckGameCenterID(ctx context.Context, playerID string, bundleID string, timestamp int64, ...) (bool, error)
- func (c *Client) CheckGoogleToken(ctx context.Context, idToken string) (*GoogleProfile, error)
- func (c *Client) GetFacebookFriends(ctx context.Context, accessToken string) ([]FacebookProfile, error)
- func (c *Client) GetFacebookProfile(ctx context.Context, accessToken string) (*FacebookProfile, error)
- func (c *Client) GetSteamProfile(ctx context.Context, publisherKey string, appID int, ticket string) (*SteamProfile, error)
- type FacebookProfile
- type GoogleProfile
- type SteamError
- type SteamProfile
- type SteamProfileWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is responsible for making calls to different providers
func (*Client) CheckGameCenterID ¶
func (c *Client) CheckGameCenterID(ctx context.Context, playerID string, bundleID string, timestamp int64, salt string, signature string, publicKeyURL string) (bool, error)
CheckGameCenterID checks to see validity of the GameCenter playerID
func (*Client) CheckGoogleToken ¶
CheckGoogleToken extracts the user's Google Profile from a given ID token.
func (*Client) GetFacebookFriends ¶
func (c *Client) GetFacebookFriends(ctx context.Context, accessToken string) ([]FacebookProfile, error)
GetFacebookFriends queries the Facebook Graph. Token is expected to also have the "user_friends" permission.
func (*Client) GetFacebookProfile ¶
func (c *Client) GetFacebookProfile(ctx context.Context, accessToken string) (*FacebookProfile, error)
GetFacebookProfile retrieves the user's Facebook Profile given the accessToken
func (*Client) GetSteamProfile ¶
func (c *Client) GetSteamProfile(ctx context.Context, publisherKey string, appID int, ticket string) (*SteamProfile, error)
GetSteamProfile retrieves the user's Steam Profile. Key and App ID should be configured at the application level. See: https://partner.steamgames.com/documentation/auth#client_to_backend_webapi
type FacebookProfile ¶
type FacebookProfile struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Gender string `json:"gender"`
Locale string `json:"locale"`
Timezone float64 `json:"timezone"`
}
FacebookProfile is an abbreviated version of a Facebook profile.
type GoogleProfile ¶
type GoogleProfile struct {
// Fields available in all tokens.
Iss string `json:"iss"`
Sub string `json:"sub"`
Azp string `json:"azp"`
Aud string `json:"aud"`
Iat int64 `json:"iat"`
Exp int64 `json:"exp"`
// Fields available only if the user granted the "profile" and "email" OAuth scopes.
Email string `json:"email"`
EmailVerified bool `json:"email_verified"`
Name string `json:"name"`
Picture string `json:"picture"`
GivenName string `json:"given_name"`
FamilyName string `json:"family_name"`
Locale string `json:"locale"`
}
GoogleProfile is an abbreviated version of a Google profile extracted from in a verified ID token.
type SteamError ¶
SteamError contains a possible error response from the Steam Web API.
type SteamProfile ¶
type SteamProfile struct {
SteamID uint64 `json:"steamid,string"`
}
SteamProfile is an abbreviated version of a Steam profile.
type SteamProfileWrapper ¶
type SteamProfileWrapper struct {
Response struct {
Params *SteamProfile `json:"params"`
Error *SteamError `json:"error"`
} `json:"response"`
}
Unwrapping the SteamProfile