PHPackages                             bastiaandewaele/oauth2-tiktok - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. bastiaandewaele/oauth2-tiktok

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

bastiaandewaele/oauth2-tiktok
=============================

v2.0.0(2y ago)765.0k—4.5%51MITPHPPHP &gt;=7.4|^8.0

Since Mar 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/bastiaandewaele/oauth2-tiktok)[ Packagist](https://packagist.org/packages/bastiaandewaele/oauth2-tiktok)[ RSS](/packages/bastiaandewaele-oauth2-tiktok/feed)WikiDiscussions v2.x.x Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (14)Used By (1)

TikTok v2 Provider for OAuth 2.0 Client
=======================================

[](#tiktok-v2-provider-for-oauth-20-client)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/bastiaandewaele/oauth2-tiktok/blob/master/LICENSE.md)

This package provides TikTok OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

Requirements
------------

[](#requirements)

The following versions of PHP are supported.

- PHP 7.4
- PHP 8.0
- PHP 8.1

Installation
------------

[](#installation)

```
$ composer require bastiaandewaele/oauth2-tiktok
```

Scopes
------

[](#scopes)

Ensure that your app has the following scopes enabled when creating [an app](https://developers.tiktok.com/apps/).

- user.info.basic
- video.list
- video.upload
- video.publish

With the scopes above, the resource owner will fetch the fields `avatar_url`, `avatar_url_100`, `avatar_url_200` , `avatar_large_url` , `display_name`.

### More fields

[](#more-fields)

If you need [fields](https://developers.tiktok.com/doc/tiktok-api-scopes/) for metrics or profile link you need to add more scopes.

```
$authorizationUrl = $this->provider->getAuthorizationUrl(
    [
        'scope' => [
            'user.info.basic',
            'video.list',
            'video.upload',
            'video.publish',
            // These scopes only work if TikTok approved them
            'user.info.profile', //
