PHPackages                             zechdc/oauth1-etrade - 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. zechdc/oauth1-etrade

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

zechdc/oauth1-etrade
====================

ETrade OAuth 1.0 Client Provider for The PHP League OAuth1-Client

1.3(8y ago)150MITPHPPHP &gt;=5.4.0

Since Nov 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/zechdc/oauth1-etrade)[ Packagist](https://packagist.org/packages/zechdc/oauth1-etrade)[ RSS](/packages/zechdc-oauth1-etrade/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (3)Versions (5)Used By (0)

Etrade Provider for OAuth 1.0 Client
====================================

[](#etrade-provider-for-oauth-10-client)

This package provides Etrade OAuth 1.0 support for the PHP League's [OAuth 1.0 Client](https://github.com/thephpleague/oauth1-client).

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

[](#installation)

To install, use composer:

```
composer require zechdc/oauth1-etrade

```

Usage
-----

[](#usage)

Usage is the same as The League's OAuth client, using `Zechdc\OAuth1\Client\Server\Etrade` as the provider.

You must contact Etrade to setup your callback URL.

```
//Step 1, setup an Etrade instance
$server = new Zechdc\OAuth1\Client\Server\Etrade(array(
    'identifier'   => 'oauth_customer_key',
    'secret'       => 'consumer_secret',
));

//Step 2, get create your Request Token ($temporaryCredentials)
public function getRequestTokenAndAuthorizeApplication(){

    //This creates your Request Token
    $temporaryCredentials = $this->server->getTemporaryCredentials();

    //Save the $temporaryCredentials in a session or DB to be used later.
    Session::set('temporary_credentials', $temporaryCredentials);

    //This will allow the user to Authorize your Application. It will redirect the user
    //to etrade. After they login and accept your application, it will either
    // 1) Redirect to your website - this requires you to contact etrade customer support and setup a callback url
    // 2) Etrade will show you a code called the oauth_verifier which you can manually copy into the next step.
    $this->server->authorize($temporaryCredentials);
}

//Step 3, use the request token ($temporaryCredentials) and the oauth_verifier provided by etrade to create your Access Token
public function getAccessToken(){
    //Get our temporary credentials from our storage
    $temporaryCredentials = Session::get('temporary_credentials');
    $requestToken = $temporaryCredentials->getIdentifier();

    //The code the user received after authorizing the application.
    $oauthVerifier = $_GET['oauth_verifier'];

    //This gets our Access Token
    $tokenCredentials = $this->server->getTokenCredentials($temporaryCredentials, $requestToken, $oauthVerifier);

    //Save the Access Token so we can make and authorize more API calls.
    Session::set('token_credentials', $tokenCredentials);
}

//Step 4, now that you have your Access Token, lets call an endpoint
public function getMarketData(){
    $client = new Guzzle\Client();
    $accessToken = Session::get('token_credentials');
    $url = "https://etwssandbox.etrade.com/market/sandbox/rest/quote/GOOGL.json";
    $method = 'GET';
    $params = ['detailFlag' => 'FUNDAMENTAL'];

    //This constructs our Authorization header and the oauth signature.
    $headers = $this->server->getHeaders($accessToken, $method, $url, $params);

    $res = $client->request($method, $url, [
      'headers' => $headers,
      'query' => $params
    ]);

    echo $res->getStatusCode();
    echo $res->getBody();
}
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

Every ~4 days

Total

4

Last Release

3092d ago

### Community

Maintainers

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

---

Top Contributors

[![zechdc](https://avatars.githubusercontent.com/u/418525?v=4)](https://github.com/zechdc "zechdc (9 commits)")

---

Tags

clientoauthauthorizationauthorisationoauth1stocksetrade

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zechdc-oauth1-etrade/health.svg)

```
[![Health](https://phpackages.com/badges/zechdc-oauth1-etrade/health.svg)](https://phpackages.com/packages/zechdc-oauth1-etrade)
```

###  Alternatives

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