https://github.com/seinopsys/oauth2-deviantart
DeviantArt Provider for OAuth 2.0 Client
https://github.com/seinopsys/oauth2-deviantart
deviantart oauth2 oauth2-client php
Last synced: about 2 months ago
JSON representation
DeviantArt Provider for OAuth 2.0 Client
- Host: GitHub
- URL: https://github.com/seinopsys/oauth2-deviantart
- Owner: SeinopSys
- License: mit
- Created: 2017-07-10T02:15:38.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-01-13T08:56:54.000Z (over 8 years ago)
- Last Synced: 2025-02-28T06:10:48.345Z (over 1 year ago)
- Topics: deviantart, oauth2, oauth2-client, php
- Language: PHP
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DeviantArt Provider for OAuth 2.0 Client
[](https://travis-ci.org/seinopsys/oauth2-deviantart)
[](https://packagist.org/packages/seinopsys/oauth2-deviantart)
[DeviantArt](https://deviantart.com/) OAuth 2.0 support for the PHP League’s [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).
## Installation
```
$ composer require seinopsys/oauth2-deviantart
```
## Usage
You can get your OAuth client credentials [here](https://www.deviantart.com/developers/apps).
```php
$provider = new SeinopSys\OAuth2\Client\Provider\DeviantArtProvider([
'clientId' => 'client_id',
'clientSecret' => 'client_secret',
'redirectUri' => 'http://example.com/auth',
]);
$accessToken = $provider->getAccessToken('authorization_code', [
'code' => $_GET['code'],
'scope' => ['user','browse'] // optional, defaults to ['user']
]);
$actualToken = $accessToken->getToken();
$refreshToken = $accessToken->getRefresh();
// Once it expires
$newAccessToken = $provider->getAccessToken('refresh_token', [
'refresh_token' => $refreshToken
]);
```