Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chanioxaris/tiktok-oauth2
Go package for TikTok OAuth 2.0 support
https://github.com/chanioxaris/tiktok-oauth2
oauth2 tiktok
Last synced: 4 days ago
JSON representation
Go package for TikTok OAuth 2.0 support
- Host: GitHub
- URL: https://github.com/chanioxaris/tiktok-oauth2
- Owner: chanioxaris
- License: mit
- Created: 2021-07-17T09:42:47.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-18T07:59:18.000Z (over 3 years ago)
- Last Synced: 2024-06-20T15:51:12.333Z (5 months ago)
- Topics: oauth2, tiktok
- Language: Go
- Homepage:
- Size: 41 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tiktok-oauth2
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://raw.githubusercontent.com/chanioxaris/tiktok-oauth2/master/LICENSE)
[![GoDoc](https://godoc.org/github.com/chanioxaris/json-server?status.svg)](https://pkg.go.dev/github.com/chanioxaris/tiktok-oauth2)
[![codecov](https://codecov.io/gh/chanioxaris/tiktok-oauth2/branch/master/graph/badge.svg?token=FcdhuSfrfA)](https://codecov.io/gh/chanioxaris/tiktok-oauth2)
[![goreportcard](https://goreportcard.com/badge/github.com/chanioxaris/json-server)](https://goreportcard.com/report/github.com/chanioxaris/tiktok-oauth2)A package to add support for TikTok OAuth 2.0 on top of the Golang's package ([https://github.com/golang/oauth2](https://github.com/golang/oauth2))
You can find the official TikTok documentation [here](https://developers.tiktok.com/doc)
### Install
`$ go get github.com/chanioxaris/tiktok-oauth2`### Available functions
- `NewConfig()` Create a new TikTok oauth2 config
- `ConfigExchange()` Convert an oauth2 config into an oauth2 token
- `RefreshToken()` Refresh the access token
- `RevokeAccess()` Revoke the access token
- `RetrieveUserInfo()` Retrieve basic information of a TikTok user### Helper functions
- `OpenIDFromToken()` Retrieve the extra field `open_id` from an oauth2 token.
- `ScopeFromToken()` Retrieve the extra field `scope` from an oauth2 token.
- `RefreshExpiresInFromToken()` Retrieve the extra field `refresh_expires_in` from an oauth2 token.### License
tiktok-oauth2 is [MIT licensed](LICENSE).