PHPackages                             dan-rogers/oauth-php - 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. dan-rogers/oauth-php

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

dan-rogers/oauth-php
====================

Library for OAuth 1 and OAuth 2 workflows.

v1.0.2(3y ago)131MITPHPPHP &gt;= 5.6

Since Sep 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/DanRVP/OAuth-PHP)[ Packagist](https://packagist.org/packages/dan-rogers/oauth-php)[ RSS](/packages/dan-rogers-oauth-php/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

OAuth-PHP
=========

[](#oauth-php)

A PHP Library for OAuth 1 and OAuth 2 workflows.

### Installation

[](#installation)

```
composer require dan-rogers/oauth-php

```

### Usage

[](#usage)

OAuth 1 Example

- Use an array of options to create a config for your auth generation.
- Construct a new `OAuth1Config` object and use the array as the argument.
- Construct a new `OAuth1` object and use your `OAuth1Config` object as the argument.
- Call generateAuthorization().

So long as you have provided the correct information for the OAuth1 step you are on, it will generate a valid auth header.

For more information on OAuth 1 usage see:

-
-

```
#!/usr/bin/php
