2017 © Pedro Peláez
 

library oauth2-chatwork

ChatWork OAuth 2.0 Client Provider for The PHP League OAuth2-Client

image

chatwork/oauth2-chatwork

ChatWork OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 3 Versions
  • 35 % Grown

The README.md

ChatWork Provider for OAuth 2.0 Client

Build Status Latest Stable Version License, (*1)

Installation

composer require chatwork/oauth2-chatwork

Usage

$provider = new ChatWorkProvider(
    getenv('OAUTH2_CLIENT_ID'),
    getenv('OAUTH2_CLIENT_SECRET'),
    getenv('OAUTH2_REDIRECT_URI')
);

$url = $provider->getAuthorizationUrl([
    'scope' => ['users.all:read', 'rooms.all:read_write']
]);

Get an access token

$accessToken = $provider->getAccessToken((string) new AuthorizationCode(), [
    'code' => $code
]);

Refresh a token

if ($accessToken->hasExpired()) {
    $refreshedAccessToken = $provider->getAccessToken((string) new RefreshToken(), [
        'refresh_token' => $accessToken->getRefreshToken()
    ]);
}

Get resource owner's profile

$resource_owner = $provider->getResourceOwner($accessToken);

Example

An example of ChatWork OAuth2 client, (*2)

ChatWork OAuth2.0 document

API Document, (*3)

Blog

チャットワークのOAuth2のクライアントをPHPで簡単に実装するためのライブラリを紹介, (*4)

Contributing

Testing

$ make test

License

The MIT License (MIT)., (*5)

The Versions

15/03 2018

dev-master

9999999-dev

ChatWork OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

authorization oauth client oauth2 chatwork

24/11 2017

v0.1.1

0.1.1.0

ChatWork OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

authorization oauth client oauth2 chatwork

24/11 2017

v0.1.0

0.1.0.0

ChatWork OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

The Development Requires

authorization oauth client oauth2 chatwork