Documentation ¶
Overview ¶
Package tiktok provides support for making OAuth2 authorized and authenticated HTTP requests on TikTok platform.
Index ¶
- func ConfigExchange(ctx context.Context, config *oauth2.Config, code string) (*oauth2.Token, error)
- func NewConfig(clientID, clientSecret, redirectURL string, scopes ...string) (*oauth2.Config, error)
- func OpenIDFromToken(token *oauth2.Token) (string, error)
- func RefreshExpiresInFromToken(token *oauth2.Token) (int64, error)
- func RefreshToken(ctx context.Context, clientID, refreshToken string) (*oauth2.Token, error)
- func RevokeAccess(ctx context.Context, token *oauth2.Token) error
- func ScopeFromToken(token *oauth2.Token) (string, error)
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigExchange ¶
ConfigExchange converts an oauth2 config and authorization code into an oauth2 token.
func NewConfig ¶
func NewConfig(clientID, clientSecret, redirectURL string, scopes ...string) (*oauth2.Config, error)
NewConfig returns a new TikTok oauth2 config based on provided arguments.
func OpenIDFromToken ¶
OpenIDFromToken is a helper function to retrieve 'open_id' extra field from an oauth2 token.
func RefreshExpiresInFromToken ¶
RefreshExpiresInFromToken is a helper function to retrieve 'refresh_expires_in' extra field from an oauth2 token.
func RefreshToken ¶
RefreshToken refreshes the access token of the user.
func RevokeAccess ¶
RevokeAccess revokes a user's access token.
Types ¶
Click to show internal directories.
Click to hide internal directories.