mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-16 18:19:47 +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,18 +229,28 @@ 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()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new authorisation code
|
||||||
|
*
|
||||||
|
* @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',
|
public function newAuthCode(string $clientId, $type = 'user',
|
||||||
string $typeId, string $redirectUri, $scopes = array(),
|
string $typeId, string $redirectUri, $scopes = array(),
|
||||||
string $accessToken = null)
|
string $accessToken = null)
|
||||||
@ -283,12 +301,10 @@ class Server
|
|||||||
/**
|
/**
|
||||||
* 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 = '?')
|
||||||
|
Loading…
Reference in New Issue
Block a user