Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/OAuth2/ClientAssertionType/HttpBasic.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ class HttpBasic implements ClientAssertionTypeInterface

/**
* Config array $config should look as follows:
* @code
* <code>
* $config = array(
* 'allow_credentials_in_request_body' => true, // whether to look for credentials in the POST body in addition to the Authorize HTTP Header
* 'allow_public_clients' => true // if true, "public clients" (clients without a secret) may be authenticated
* );
* @endcode
* </code>
*
* @param ClientCredentialsInterface $storage Storage
* @param array $config Configuration options for the server
Expand Down Expand Up @@ -101,12 +101,12 @@ public function getClientId()
* @param RequestInterface $request
* @param ResponseInterface $response
* @return array|null A list containing the client identifier and password, for example:
* @code
* <code>
* return array(
* "client_id" => CLIENT_ID, // REQUIRED the client id
* "client_secret" => CLIENT_SECRET, // OPTIONAL the client secret (may be omitted for public clients)
* );
* @endcode
* </code>
*
* @see http://tools.ietf.org/html/rfc6749#section-2.3.1
*
Expand Down
4 changes: 2 additions & 2 deletions src/OAuth2/Controller/AuthorizeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ class AuthorizeController implements AuthorizeControllerInterface
* keys are "code" and "token"
* @param array $config OPTIONAL Configuration options for the server:
* @param ScopeInterface $scopeUtil OPTIONAL Instance of OAuth2\ScopeInterface to validate the requested scope
* @code
* <code>
* $config = array(
* 'allow_implicit' => false, // if the controller should allow the "implicit" grant type
* 'enforce_state' => true // if the controller should require the "state" parameter
* 'require_exact_redirect_uri' => true, // if the controller should require an exact match on the "redirect_uri" parameter
* 'redirect_status_code' => 302, // HTTP status code to use for redirect responses
* );
* @endcode
* </code>
*/
public function __construct(ClientInterface $clientStorage, array $responseTypes = array(), array $config = array(), ?ScopeInterface $scopeUtil = null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/OAuth2/Controller/AuthorizeControllerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* authorization directly, this controller ensures the request is valid, but
* requires the application to determine the value of $is_authorized
*
* @code
* <code>
* $user_id = $this->somehowDetermineUserId();
* $is_authorized = $this->somehowDetermineUserAuthorization();
* $response = new OAuth2\Response();
Expand All @@ -22,7 +22,7 @@
* $user_id
* );
* $response->send();
* @endcode
* </code>
*/
interface AuthorizeControllerInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/OAuth2/Controller/ResourceControllerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
* call verifyResourceRequest in order to determine if the request
* contains a valid token.
*
* @code
* <code>
* if (!$resourceController->verifyResourceRequest(OAuth2\Request::createFromGlobals(), $response = new OAuth2\Response())) {
* $response->send(); // authorization failed
* die();
* }
* return json_encode($resource); // valid token! Send the stuff!
* @endcode
* </code>
*/
interface ResourceControllerInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/OAuth2/Controller/TokenControllerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
* it is called to handle all grant types the application supports.
* It also validates the client's credentials
*
* @code
* <code>
* $tokenController->handleTokenRequest(OAuth2\Request::createFromGlobals(), $response = new OAuth2\Response());
* $response->send();
* @endcode
* </code>
*/
interface TokenControllerInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/OAuth2/GrantType/RefreshToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ class RefreshToken implements GrantTypeInterface
/**
* @param RefreshTokenInterface $storage - REQUIRED Storage class for retrieving refresh token information
* @param array $config - OPTIONAL Configuration options for the server
* @code
* <code>
* $config = array(
* 'always_issue_new_refresh_token' => true, // whether to issue a new refresh token upon successful token request
* 'unset_refresh_token_after_use' => true // whether to unset the refresh token after after using
* );
* @endcode
* </code>
*/
public function __construct(RefreshTokenInterface $storage, $config = array())
{
Expand Down
4 changes: 2 additions & 2 deletions src/OAuth2/OpenID/Controller/UserInfoControllerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
* This controller is called when the user claims for OpenID Connect's
* UserInfo endpoint should be returned.
*
* @code
* <code>
* $response = new OAuth2\Response();
* $userInfoController->handleUserInfoRequest(
* OAuth2\Request::createFromGlobals(),
* $response
* );
* $response->send();
* @endcode
* </code>
*/
interface UserInfoControllerInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/OAuth2/ResponseType/AccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class AccessToken implements AccessTokenInterface
* @param AccessTokenStorageInterface $tokenStorage - REQUIRED Storage class for saving access token information
* @param RefreshTokenInterface $refreshStorage - OPTIONAL Storage class for saving refresh token information
* @param array $config - OPTIONAL Configuration options for the server
* @code
* <code>
* $config = array(
* 'token_type' => 'bearer', // token type identifier
* 'access_lifetime' => 3600, // time before access token expires
* 'refresh_token_lifetime' => 1209600, // time before refresh token expires
* );
* @endcode
* </code>
*/
public function __construct(AccessTokenStorageInterface $tokenStorage, ?RefreshTokenInterface $refreshStorage = null, array $config = array())
{
Expand Down
4 changes: 2 additions & 2 deletions src/OAuth2/Storage/AccessTokenInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ interface AccessTokenInterface
* @param string $oauth_token - oauth_token to be check with.
*
* @return array|null - An associative array as below, and return NULL if the supplied oauth_token is invalid:
* @code
* <code>
* array(
* 'expires' => $expires, // Stored expiration in unix timestamp.
* 'client_id' => $client_id, // (optional) Stored client identifier.
* 'user_id' => $user_id, // (optional) Stored user identifier.
* 'scope' => $scope, // (optional) Stored scope values in space-separated string.
* 'id_token' => $id_token // (optional) Stored id_token (if "use_openid_connect" is true).
* );
* @endcode
* </code>
*
* @ingroup oauth2_section_7
*/
Expand Down
4 changes: 2 additions & 2 deletions src/OAuth2/Storage/AuthorizationCodeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ interface AuthorizationCodeInterface
*
* @return
* An associative array as below, and NULL if the code is invalid
* @code
* <code>
* return array(
* "client_id" => CLIENT_ID, // REQUIRED Stored client identifier
* "user_id" => USER_ID, // REQUIRED Stored user identifier
* "expires" => EXPIRES, // REQUIRED Stored expiration in unix timestamp
* "redirect_uri" => REDIRECT_URI, // REQUIRED Stored redirect URI
* "scope" => SCOPE, // OPTIONAL Stored scope values in space-separated string
* );
* @endcode
* </code>
*
* @see http://tools.ietf.org/html/rfc6749#section-4.1
*
Expand Down
2 changes: 0 additions & 2 deletions src/OAuth2/Storage/ClientCredentialsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ interface ClientCredentialsInterface extends ClientInterface
*
* @return
* TRUE if the client credentials are valid, and MUST return FALSE if it isn't.
* @endcode
*
* @see http://tools.ietf.org/html/rfc6749#section-3.1
*
Expand All @@ -38,7 +37,6 @@ public function checkClientCredentials($client_id, $client_secret = null);
*
* @return
* TRUE if the client is public, and FALSE if it isn't.
* @endcode
*
* @see http://tools.ietf.org/html/rfc6749#section-2.3
* @see https://github.com/bshaffer/oauth2-server-php/issues/257
Expand Down
4 changes: 2 additions & 2 deletions src/OAuth2/Storage/UserCredentialsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ public function checkUserCredentials($username, $password);
* @return array|false - the associated "user_id" and optional "scope" values
* This function MUST return FALSE if the requested user does not exist or is
* invalid. "scope" is a space-separated list of restricted scopes.
* @code
* <code>
* return array(
* "user_id" => USER_ID, // REQUIRED user_id to be stored with the authorization code or access token
* "scope" => SCOPE // OPTIONAL space-separated list of restricted scopes
* );
* @endcode
* </code>
*/
public function getUserDetails($username);
}