Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-13T08:56:54.000Z (almost 7 years ago)
- Last Synced: 2024-11-13T10:28:34.357Z (about 2 months 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
[![Build Status](https://travis-ci.org/SeinopSys/oauth2-deviantart.svg?branch=master)](https://travis-ci.org/seinopsys/oauth2-deviantart)
[![Latest Stable Version](https://poser.pugx.org/seinopsys/oauth2-deviantart/v/stable.png)](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
]);
```