PHPackages                             smtech/oauth-negotiator - 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. smtech/oauth-negotiator

Abandoned → [smtech/oauth2-canvaslms](/?search=smtech%2Foauth2-canvaslms)ArchivedLibrary[Authentication &amp; Authorization](/categories/authentication)

smtech/oauth-negotiator
=======================

Negotiate an OAuth 2 authentication or API token

v1.1.2(10y ago)1115LGPL-3.0PHP

Since Jun 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/smtech/obsolete__oauth-negotiator)[ Packagist](https://packagist.org/packages/smtech/oauth-negotiator)[ RSS](/packages/smtech-oauth-negotiator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (8)Used By (0)

Obsolete
========

[](#obsolete)

Abandoned in favor of [smtech/oauth2-canvaslms](https://github.com/smtech/oauth2-canvaslms), which extends the PHP League's excellent OAuth2 Client.

OAuthNegotiator
===============

[](#oauthnegotiator)

[![Latest Version](https://camo.githubusercontent.com/d69b017ab8242eabeed1d3515b7c0c0432c19b250217fe9a93d3f61164a6fa27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736d746563682f6f617574682d6e65676f746961746f722e737667)](https://packagist.org/packages/smtech/oauth-negotiator)

I find it difficult to wrap my head around negotiating for OAuth tokens -- and I would prefer not to have to think about it. This is particularly focused on negotiating with *Instructure Canvas* for OAuth tokens, to be sure.

### Usage

[](#usage)

Include in your `composer.json` file:

```
{
  "requires" : {
    "smtech/oauth-negotiator": "1.0"
  }
}
```

When you would like to acquire a token, the easiest use of this is to provide three pages (keep reading for a single page variant):

#### page1.php

[](#page1php)

```

      Enter the URL of your canvas instance

```

#### page2.php

[](#page2php)

`page2.php` will be re-loaded several times throughout the negotiation, so it's easiest to simply isolate this part of the negotiation on its own page and redirect in and out of that page.

```
