PHPackages                             ova777/tsoauth - 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. ova777/tsoauth

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

ova777/tsoauth
==============

Tronsalt OAuth library

v1.0.3(9y ago)013MITPHPPHP &gt;=5.3

Since Aug 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ova777/tsoauth)[ Packagist](https://packagist.org/packages/ova777/tsoauth)[ Docs](http://github.com/ova777/tsoauth)[ RSS](/packages/ova777-tsoauth/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (5)Used By (0)

tsoauth
=======

[](#tsoauth)

Tronsalt OAuth library

Usage:
------

[](#usage)

### Create TSOauth object

[](#create-tsoauth-object)

```
use ova777\TSOAuth;

$tsoauth = TSOAuth\Core::create(array(
    'auto_refresh_token' => true,
    'id' => 'OAUTH_CLIENT_ID',
    'secret' => 'OAUTH_CLIENT_SECRET',
    'host' => 'https://tronsalt.ru',
    'access_token' => '', //If exists
    'refresh_token' => '', //If exists
    'scope' => array('user.data'), //Required permissions
));
```

### Reirect to User authentication

[](#reirect-to-user-authentication)

```
$tsoauth->goAuthorizationCode();
```

### If User click "Cancel" (denied access)

[](#if-user-click-cancel-denied-access)

There is redirect to your REDIRECT\_URI with GET parameters "error" and "error\_description"

```
if(isset($_GET['error'])) { ?>
