Skip to content

TemiJ/super-simple-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

#Super Simple Auth

Super simple and basic examples for authenticating to a REST API

To use the following examples create a php(e.g index.php) file in the root of this directory and copy and paste th code samples below.

#Basic Authentication Example To Authenticate with just a username and password.

require_once 'Class/BasicAuth.php';

$url = 'endpoint URL';
$username = 'your username';
$password = 'your password';

new BasicAuth($url, $username, $password);

#Authentication with OAuth.

require_once 'Class/Oauth.php';

$reqUrl  = 'Request Token';
$authUrl = 'Authorize URL';
$accUrl  = 'Access Token URL';
$apiUrl  = 'API URL';
$consKey = 'Consumer Key';
$consSec = 'Consumer Secret';
// This is optional an defaults to 0
// set to 1 to turn on debugging.
$debug = 1;

new Oauthenticate($consKey, $consSec, $apiUrl, $accUrl, $authUrl, $reqUrl, $debug);

About

Super simple examples for authenticating to REST APIs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages