oauth2-server/src/oauth2server/DbInterface.php

78 lines
1.7 KiB
PHP
Raw Normal View History

2012-07-06 12:50:19 +05:30
<?php
interface OAuth2ServerDatabase
{
public function validateClient(
string $clientId,
string $clientSecret = null,
string $redirectUri = null
);
2012-07-06 12:50:19 +05:30
public function newSession(
string $clientId,
string $redirectUri,
2012-07-06 18:35:21 +05:30
$type = 'user',
string $typeId = null,
string $authCode = null,
string $accessToken = null,
2012-07-06 18:35:21 +05:30
$stage = 'request'
);
2012-07-06 12:50:19 +05:30
public function updateSession(
string $clientId,
2012-07-06 18:35:21 +05:30
$type = 'user',
string $typeId = null,
string $authCode = null,
string $accessToken = null,
string $stage
);
2012-07-06 12:50:19 +05:30
public function deleteSession(
string $clientId,
2012-07-06 23:50:04 +05:30
string $type,
string $typeId
);
2012-07-06 12:50:19 +05:30
public function validateAuthCode(
string $clientId,
string $redirectUri,
string $authCode
);
2012-07-06 12:50:19 +05:30
2012-07-06 23:50:21 +05:30
/**
* Has access token
*
* Check if an access token exists for a user (or an application)
*
* @access public
* @return bool|string Return FALSE is a token doesn't exist or return the
* access token as a string
*/
public function hasAccessToken(
string $typeId,
string $clientId
);
2012-07-06 12:50:19 +05:30
public function getAccessToken(int $sessionId);
public function removeAuthCode(int $sessionId);
public function setAccessToken(
int $sessionId,
string $accessToken
);
2012-07-06 12:50:19 +05:30
public function addSessionScope(
int $sessionId,
string $scope
);
2012-07-06 12:50:19 +05:30
public function getScope(string $scope);
public function updateSessionScopeAccessToken(
int $sesstionId,
string $accessToken
);
2012-07-06 12:50:19 +05:30
public function accessTokenScopes(string $accessToken);
}