First commit

This commit is contained in:
Alex Bilbie 2012-07-05 17:38:58 +01:00
parent 5a98658812
commit 7bca63a18f
6 changed files with 126 additions and 0 deletions

33
composer.json Normal file
View File

@ -0,0 +1,33 @@
{
"name": "lncd/oauth2server",
"description": "OAuth 2.0 server",
"version": "0.0.1",
"require": {
"php": ">=5.3.0",
},
"repositories": [
{
"type": "git",
"url": "https://github.com/lncd/oauth2server"
}
],
"keywords": [
"oauth",
"oauth2",
"server"
],
"license": "MIT",
"authors": [
{
"name": "Alex Bilbie",
"email": "php-oauth2-server@alexbilbie.com",
"homepage": "http://www.httpster.org",
"role": "Developer"
}
],
"autoload": {
"psr-0": {
"oauth2server": "src/"
}
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace LNCD\OAuth2server;
class AccessToken
{
function __construct()
{
}
public function get(int $sessionId)
{
// returns an access token that the user may already have (else generate a new one)
}
public function validate(string $accessToken, array $scopes)
{
// tests if an access token is valid
}
private function set(int $sessionId)
{
// generate a new access token
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace LNCD\OAuth2server;
class Client
{
protected $id;
protected $secret;
protected $redirect_uri
public function __construct()
{
}
public function validate(array $details)
{
}
public function redirectUri(string $redirectUri, array $params, $queryDelimeter = '?')
{
// Generates the redirect uri with appended params
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace LNCD\OAuth2server;
class Scope
{
public function exists(string $scope)
{
// tests if a scope exists
}
public function details($scopes)
{
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace LNCD\OAuth2server;
class Server
{
public function __construct()
{
}
public function registerDbAbstractor()
{
}
}

8
src/oauth2server/db.php Normal file
View File

@ -0,0 +1,8 @@
<?php
namespace LNCD\OAuth2server;
interface OAuth2ServerDatabase
{
}