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

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

flipboxdigital/oauth2-salesforce
================================

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

1.0.0(8y ago)07561MITPHP

Since Feb 22Pushed 8y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (5)Versions (2)Used By (1)

Salesforce Provider for OAuth 2.0 Client
========================================

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

[![Join the chat at https://gitter.im/flipbox/oauth2-salesforce](https://camo.githubusercontent.com/64b7088fda683d00e383683bd26d427c54650718f9eccf36aad8a7cb930affdd/68747470733a2f2f6261646765732e6769747465722e696d2f666c6970626f782f6f61757468322d73616c6573666f7263652e737667)](https://gitter.im/flipbox/oauth2-salesforce?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![Latest Version](https://camo.githubusercontent.com/37fcf7d693517ee02246ea390862b9853d9ef45e23267faba0fa777d941e59ed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f666c6970626f782f6f61757468322d73616c6573666f7263652e7376673f7374796c653d666c61742d737175617265)](https://github.com/flipbox/oauth2-salesforce/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/56a4027364d0a3366212d5d08702ae755b1cd9ce8b9f6583fe517e594f4ccd1d/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f666c6970626f782f6f61757468322d73616c6573666f7263652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/flipbox/oauth2-salesforce)[![Coverage Status](https://camo.githubusercontent.com/1a5e3a41b28cb8d49ac52ed3ee9e482025f24ac4be58cd3f2f3ea9be34efac0a/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f666c6970626f782f6f61757468322d73616c6573666f7263652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/flipbox/oauth2-salesforce/code-structure)[![Quality Score](https://camo.githubusercontent.com/73607f60ca266b1ba777cc8dc3f8dc377b16db14e12617bdf828f62ddebcea19/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f666c6970626f782f6f61757468322d73616c6573666f7263652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/flipbox/oauth2-salesforce)[![Total Downloads](https://camo.githubusercontent.com/90822a87c68478bc77842cc31f8c8a3554efbd505f5a23ffdf598b3865542f81/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666c6970626f786469676974616c2f6f61757468322d73616c6573666f7263652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/flipboxdigital/oauth2-salesforce)

This package provides Salesforce OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/flipbox/oauth2-client).

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

[](#installation)

To install, use composer:

```
composer require flipboxdigital/oauth2-salesforce

```

Usage
-----

[](#usage)

Usage is the same as The League's OAuth client, using `\Flipbox\OAuth2\Client\Provider\Salesforce` as the provider.

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new Flipbox\OAuth2\Client\Provider\Salesforce([
    'clientId'          => '{salesforce-client-id}',
    'clientSecret'      => '{salesforce-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url',
    'domain'            => '{custom-salesforce-domain}' // optional, defaults to https://login.salesforce.com
    'apiVersion'        => '{custom-salesforce-api-version}' // optional, defaults to v21.0
]);
```

For further usage of this package please refer to the [core package documentation on "Authorization Code Grant"](https://github.com/thephpleague/oauth2-client#usage).

### Refreshing a Token

[](#refreshing-a-token)

```
$provider = new Flipbox\OAuth2\Client\Provider\Salesforce([
    'clientId'          => '{salesforce-client-id}',
    'clientSecret'      => '{salesforce-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url'
]);

$existingAccessToken = getAccessTokenFromYourDataStore();

if ($existingAccessToken->hasExpired()) {
    $newAccessToken = $provider->getAccessToken('refresh_token', [
        'refresh_token' => $existingAccessToken->getRefreshToken()
    ]);

    // Purge old access token and store new access token to your data store.
}
```

### Using a custom Salesforce domain

[](#using-a-custom-salesforce-domain)

```
$provider->setDomain('https://foo-bar.salesforce.com');
```

For further usage of this package please refer to the [core package documentation on "Refreshing a Token"](https://github.com/thephpleague/oauth2-client#refreshing-a-token).

Testing
-------

[](#testing)

```
$ ./vendor/bin/phpunit
```

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/flipbox/oauth2-salesforce/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Flipbox Digital](https://github.com/flipbox)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/flipbox/oauth2-salesforce/blob/master/LICENSE) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Unknown

Total

1

Last Release

2997d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f88ef7075dc76a34393f80402c30cc8eec30d5134835314136669a68b8ce817f?d=identicon)[nateiler](/maintainers/nateiler)

---

Top Contributors

[![nateiler](https://avatars.githubusercontent.com/u/1892443?v=4)](https://github.com/nateiler "nateiler (1 commits)")

---

Tags

clientoauthoauth2authorizationauthorisationsaleforce

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[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)
