Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jublo/oauth-validator-php
A library for validating OAuth signatures in PHP.
https://github.com/jublo/oauth-validator-php
Last synced: about 2 months ago
JSON representation
A library for validating OAuth signatures in PHP.
- Host: GitHub
- URL: https://github.com/jublo/oauth-validator-php
- Owner: jublo
- License: gpl-3.0
- Created: 2014-11-19T17:14:04.000Z (about 10 years ago)
- Default Branch: develop
- Last Pushed: 2018-07-06T08:41:43.000Z (over 6 years ago)
- Last Synced: 2024-11-10T11:47:24.523Z (about 2 months ago)
- Language: PHP
- Size: 145 KB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
Awesome Lists containing this project
README
oauth-validator-php
===================
*A library for validating OAuth signatures in PHP.*Copyright (C) 2014 Jublo Solutions
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program. If not, see .### Requirements
- PHP 5.3.0 or higher
## Validating an OAuth signature
To validate an OAuth signature, provide the consumer key and secret,
as well as the token.```php
require_once 'oauth-validator.php';\Jublo\Oauth_Validator::setConsumerKey('******', '******');
$ov = \Jublo\Oauth_Validator::getInstance();
$ov->setToken("******", "******");$params = array(
'status' => 'Hashtags are cool, when they work. http://www.example.com/gear#id=3&type=store'
);$authorization = 'OAuth oauth_consumer_key="******", oauth_nonce="6f8b2bc8", oauth_signature="DRicJWVJQFOxdnRgh7hsyvqd8sQ%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1416406562", oauth_token="******", oauth_version="1.0"';
$reply = $ov->validate($authorization, 'POST', 'https://api.twitter.com/1.1/statuses/update.json', $params);
var_dump($reply);
```