mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-28 07:50:23 +05:30
First commit
This commit is contained in:
parent
5a98658812
commit
7bca63a18f
33
composer.json
Normal file
33
composer.json
Normal 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/"
|
||||
}
|
||||
}
|
||||
}
|
26
src/oauth2server/AccessToken.php
Normal file
26
src/oauth2server/AccessToken.php
Normal 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
|
||||
}
|
||||
}
|
25
src/oauth2server/Client.php
Normal file
25
src/oauth2server/Client.php
Normal 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
|
||||
}
|
||||
}
|
16
src/oauth2server/Scope.php
Normal file
16
src/oauth2server/Scope.php
Normal 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)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
18
src/oauth2server/Server.php
Normal file
18
src/oauth2server/Server.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace LNCD\OAuth2server;
|
||||
|
||||
class Server
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function registerDbAbstractor()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
8
src/oauth2server/db.php
Normal file
8
src/oauth2server/db.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace LNCD\OAuth2server;
|
||||
|
||||
interface OAuth2ServerDatabase
|
||||
{
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user