2012-07-06 12:50:19 +05:30
|
|
|
<?php
|
|
|
|
|
|
|
|
interface OAuth2ServerDatabase
|
|
|
|
{
|
2012-07-06 18:08:05 +05:30
|
|
|
public function validateClient(
|
|
|
|
string $clientId,
|
2012-07-06 18:21:05 +05:30
|
|
|
string $clientSecret = null,
|
|
|
|
string $redirectUri = null
|
2012-07-06 18:08:05 +05:30
|
|
|
);
|
2012-07-06 12:50:19 +05:30
|
|
|
|
2012-07-06 18:08:05 +05:30
|
|
|
public function newSession(
|
|
|
|
string $clientId,
|
|
|
|
string $redirectUri,
|
2012-07-06 18:35:21 +05:30
|
|
|
$type = 'user',
|
2012-07-06 18:21:05 +05:30
|
|
|
string $typeId = null,
|
|
|
|
string $authCode = null,
|
|
|
|
string $accessToken = null,
|
2012-07-06 18:35:21 +05:30
|
|
|
$stage = 'request'
|
2012-07-06 18:08:05 +05:30
|
|
|
);
|
2012-07-06 12:50:19 +05:30
|
|
|
|
2012-07-06 18:08:05 +05:30
|
|
|
public function updateSession(
|
|
|
|
string $clientId,
|
2012-07-06 18:35:21 +05:30
|
|
|
$type = 'user',
|
2012-07-06 18:21:05 +05:30
|
|
|
string $typeId = null,
|
|
|
|
string $authCode = null,
|
|
|
|
string $accessToken = null,
|
2012-07-06 18:08:05 +05:30
|
|
|
string $stage
|
|
|
|
);
|
2012-07-06 12:50:19 +05:30
|
|
|
|
2012-07-06 18:08:05 +05:30
|
|
|
public function deleteSession(
|
|
|
|
string $clientId,
|
2012-07-06 23:50:04 +05:30
|
|
|
string $type,
|
2012-07-06 18:08:05 +05:30
|
|
|
string $typeId
|
|
|
|
);
|
2012-07-06 12:50:19 +05:30
|
|
|
|
2012-07-06 18:08:05 +05:30
|
|
|
public function validateAuthCode(
|
|
|
|
string $clientId,
|
|
|
|
string $redirectUri,
|
|
|
|
string $authCode
|
|
|
|
);
|
2012-07-06 12:50:19 +05:30
|
|
|
|
|
|
|
public function getAccessToken(int $sessionId);
|
|
|
|
|
|
|
|
public function removeAuthCode(int $sessionId);
|
|
|
|
|
2012-07-06 18:08:05 +05:30
|
|
|
public function setAccessToken(
|
|
|
|
int $sessionId,
|
|
|
|
string $accessToken
|
|
|
|
);
|
2012-07-06 12:50:19 +05:30
|
|
|
|
2012-07-06 18:08:05 +05:30
|
|
|
public function addSessionScope(
|
|
|
|
int $sessionId,
|
|
|
|
string $scope
|
|
|
|
);
|
2012-07-06 12:50:19 +05:30
|
|
|
|
|
|
|
public function getScope(string $scope);
|
|
|
|
|
2012-07-06 18:08:05 +05:30
|
|
|
public function updateSessionScopeAccessToken(
|
|
|
|
int $sesstionId,
|
|
|
|
string $accessToken
|
|
|
|
);
|
2012-07-06 12:50:19 +05:30
|
|
|
|
|
|
|
public function accessTokenScopes(string $accessToken);
|
|
|
|
}
|