PHPackages                             chatwork/oauth2-chatwork - 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. chatwork/oauth2-chatwork

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

chatwork/oauth2-chatwork
========================

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

v0.2.0(3y ago)95.6k↑1400%4[3 PRs](https://github.com/chatwork/oauth2-chatwork-php/pulls)MITPHPPHP ^7.0 || ^8.0CI passing

Since Nov 24Pushed 3mo ago66 watchersCompare

[ Source](https://github.com/chatwork/oauth2-chatwork-php)[ Packagist](https://packagist.org/packages/chatwork/oauth2-chatwork)[ RSS](/packages/chatwork-oauth2-chatwork/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (9)Used By (0)

ChatWork Provider for OAuth 2.0 Client
======================================

[](#chatwork-provider-for-oauth-20-client)

[![Build Status](https://github.com/chatwork/oauth2-chatwork-php/actions/workflows/ci.yml/badge.svg)](https://github.com/chatwork/oauth2-chatwork-php/actions/workflows/ci.yml)[![Latest Stable Version](https://camo.githubusercontent.com/87f65c49554bc4f0cd6ff0d8e57e4b385ff7e7dbe7d25ef5f9b0758561f1abb1/68747470733a2f2f706f7365722e707567782e6f72672f63686174776f726b2f6f61757468322d63686174776f726b2f76657273696f6e)](https://packagist.org/packages/chatwork/oauth2-chatwork)[![License](https://camo.githubusercontent.com/61508844e8fc68281930df2af8699725faa4838658a3e698dbc7c8c104e20a03/68747470733a2f2f706f7365722e707567782e6f72672f63686174776f726b2f6f61757468322d63686174776f726b2f6c6963656e7365)](https://packagist.org/packages/chatwork/oauth2-chatwork)

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

[](#installation)

```
composer require chatwork/oauth2-chatwork

```

Usage
-----

[](#usage)

### Get our consent page URL

[](#get-our-consent-page-url)

```
$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

[](#get-an-access-token)

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

### Refresh a token

[](#refresh-a-token)

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

### Get resource owner's profile

[](#get-resource-owners-profile)

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

Example
-------

[](#example)

[An example of ChatWork OAuth2 client](https://github.com/ada-u/chatwork-oauth2-client-example)

ChatWork OAuth2.0 document
--------------------------

[](#chatwork-oauth20-document)

[API Document](http://developer.chatwork.com/ja/oauth.html)

Blog
----

[](#blog)

[チャットワークのOAuth2のクライアントをPHPで簡単に実装するためのライブラリを紹介](http://creators-note.chatwork.com/entry/2017/12/15/104133)

Contributing
------------

[](#contributing)

### Testing

[](#testing)

```
$ make test

```

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance54

Moderate activity, may be stable

Popularity33

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~661 days

Total

4

Last Release

1112d ago

PHP version history (2 changes)v0.1.0PHP ^7.0

v0.2.0PHP ^7.0 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/bd6d14915629b8425e741ea083cda8d2e74676157a860b479d915e4728cf7281?d=identicon)[cw-tanaka](/maintainers/cw-tanaka)

![](https://www.gravatar.com/avatar/b41cea6914ef4355dab806a7c0609f131e2b5cfd5d92b41a5fb36c0e328efd8b?d=identicon)[cw-adachi](/maintainers/cw-adachi)

---

Top Contributors

[![arai-ta](https://avatars.githubusercontent.com/u/22699542?v=4)](https://github.com/arai-ta "arai-ta (34 commits)")[![ada-u](https://avatars.githubusercontent.com/u/3013078?v=4)](https://github.com/ada-u "ada-u (30 commits)")[![eiel](https://avatars.githubusercontent.com/u/92595?v=4)](https://github.com/eiel "eiel (5 commits)")[![tasuku43](https://avatars.githubusercontent.com/u/43329036?v=4)](https://github.com/tasuku43 "tasuku43 (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

clientoauthoauth2authorizationchatwork

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chatwork-oauth2-chatwork/health.svg)

```
[![Health](https://phpackages.com/badges/chatwork-oauth2-chatwork/health.svg)](https://phpackages.com/packages/chatwork-oauth2-chatwork)
```

###  Alternatives

[league/oauth2-google

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

41721.2M118](/packages/league-oauth2-google)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[stevenmaguire/oauth2-keycloak

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

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

251.7M1](/packages/mollie-oauth2-mollie-php)[omines/oauth2-gitlab

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

36721.5k13](/packages/omines-oauth2-gitlab)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
