mirror of
				https://github.com/elyby/oauth2-server.git
				synced 2025-05-31 14:12:07 +05:30 
			
		
		
		
	Move grant check for client back to validate method
This commit is contained in:
		| @@ -181,7 +181,7 @@ abstract class AbstractGrant implements GrantTypeInterface | |||||||
|  |  | ||||||
|         $clientSecret = $this->getRequestParameter('client_secret', $request, $basicAuthPassword); |         $clientSecret = $this->getRequestParameter('client_secret', $request, $basicAuthPassword); | ||||||
|  |  | ||||||
|         if ($this->clientRepository->validateClient($clientId, $clientSecret) === false) { |         if ($this->clientRepository->validateClient($clientId, $clientSecret, $this->getIdentifier()) === false) { | ||||||
|             $this->getEmitter()->emit(new RequestEvent(RequestEvent::CLIENT_AUTHENTICATION_FAILED, $request)); |             $this->getEmitter()->emit(new RequestEvent(RequestEvent::CLIENT_AUTHENTICATION_FAILED, $request)); | ||||||
|  |  | ||||||
|             throw OAuthServerException::invalidClient($request); |             throw OAuthServerException::invalidClient($request); | ||||||
|   | |||||||
| @@ -39,15 +39,9 @@ interface ClientRepositoryInterface extends RepositoryInterface | |||||||
|      * |      * | ||||||
|      * @param string      $clientIdentifier The client's identifier |      * @param string      $clientIdentifier The client's identifier | ||||||
|      * @param null|string $clientSecret     The client's secret (if sent) |      * @param null|string $clientSecret     The client's secret (if sent) | ||||||
|  |      * @param null|string $grantType        The type of grant the client is using (if sent) | ||||||
|      * |      * | ||||||
|      * @return bool |      * @return bool | ||||||
|      */ |      */ | ||||||
|     public function validateClient($clientIdentifier, $clientSecret); |     public function validateClient($clientIdentifier, $clientSecret, $grantType); | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * Check if a client can use a grant type. |  | ||||||
|      * |  | ||||||
|      * @return bool |  | ||||||
|      */ |  | ||||||
|     public function canUseGrant($clientIdentifier, $grantType); |  | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user