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,
|
|
|
|
string $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 = 'request'
|
|
|
|
);
|
2012-07-06 12:50:19 +05:30
|
|
|
|
2012-07-06 18:08:05 +05:30
|
|
|
public function updateSession(
|
|
|
|
string $clientId,
|
|
|
|
string $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,
|
|
|
|
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);
|
|
|
|
|
2012-07-06 18:08:05 +05:30
|
|
|
public function validateUser(
|
|
|
|
string $username,
|
|
|
|
string $password
|
|
|
|
);
|
2012-07-06 12:50:19 +05:30
|
|
|
}
|