mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-16 02:08:56 +05:30
Lots of docblock updates
This commit is contained in:
parent
e8db4ee20e
commit
727cdb54e7
@ -179,7 +179,15 @@ class Server
|
|||||||
return $params;
|
return $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function newAuthoriseRequest(string $typeId, array $authoriseParams)
|
/**
|
||||||
|
* Parse a new authorise request
|
||||||
|
*
|
||||||
|
* @param string $type The session owner's type
|
||||||
|
* @param string $typeId The session owner's ID
|
||||||
|
* @param array $authoriseParams The authorise request $_GET parameters
|
||||||
|
* @return string An authorisation code
|
||||||
|
*/
|
||||||
|
public function newAuthoriseRequest(string $type, string $typeId, array $authoriseParams)
|
||||||
{
|
{
|
||||||
// Check if the user already has an access token
|
// Check if the user already has an access token
|
||||||
$accessToken = $this->db->hasAccessToken($typeId,
|
$accessToken = $this->db->hasAccessToken($typeId,
|
||||||
@ -221,21 +229,31 @@ class Server
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a unique code
|
* Generate a unique code
|
||||||
*
|
*
|
||||||
* Generate a unique code for an authorisation code, or token
|
* Generate a unique code for an authorisation code, or token
|
||||||
*
|
*
|
||||||
* @access public
|
* @return string A unique code
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
private function generateCode()
|
private function generateCode()
|
||||||
{
|
{
|
||||||
return sha1(uniqid(microtime()));
|
return sha1(uniqid(microtime()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function newAuthCode(string $clientId, $type = 'user',
|
/**
|
||||||
string $typeId, string $redirectUri, $scopes = array(),
|
* Create a new authorisation code
|
||||||
string $accessToken = null)
|
*
|
||||||
|
* @param string $clientId The client ID
|
||||||
|
* @param string $type The type of the owner of the session
|
||||||
|
* @param string $typeId The session owner's ID
|
||||||
|
* @param string $redirectUri The redirect URI
|
||||||
|
* @param array $scopes The requested scopes
|
||||||
|
* @param string $accessToken The access token (default = null)
|
||||||
|
* @return string An authorisation code
|
||||||
|
*/
|
||||||
|
public function newAuthCode(string $clientId, $type = 'user',
|
||||||
|
string $typeId, string $redirectUri, $scopes = array(),
|
||||||
|
string $accessToken = null)
|
||||||
{
|
{
|
||||||
$authCode = $this->generateCode();
|
$authCode = $this->generateCode();
|
||||||
|
|
||||||
@ -278,20 +296,18 @@ class Server
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $authCode;
|
return $authCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the redirect uri with appended params
|
* Generates the redirect uri with appended params
|
||||||
*
|
*
|
||||||
* @param string $redirect_uri The redirect URI
|
* @param string $redirectUri The redirect URI
|
||||||
* @param array $params The parameters to be appended to the URL
|
* @param array $params The parameters to be appended to the URL
|
||||||
* @param string $query_delimeter The query string delimiter (default: ?)
|
* @param string $query_delimeter The query string delimiter (default: ?)
|
||||||
*
|
* @return string The updated redirect URI
|
||||||
* @access public
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
public function redirectUri(string $redirectUri, $params = array(),
|
public function redirectUri(string $redirectUri, $params = array(),
|
||||||
$queryDelimeter = '?')
|
$queryDelimeter = '?')
|
||||||
{
|
{
|
||||||
|
|
||||||
if (strstr($redirectUri, $queryDelimeter)) {
|
if (strstr($redirectUri, $queryDelimeter)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user