public function checkClientCredentials($client_id, $client_secret = null)
    {
        // Get Client
        $client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);

        // If client exists check secret
        if ($client) {
            return $client->getClientSecret() === $client_secret;
        }

        return false;
    }
public function checkClientCredentials($client_id, $client_secret = null)
    {
        // Get Client
        $client = $this->em->getRepository('OAuth2ServerBundle:Client')->find($client_id);

        // If client exists check secret
        if ($client) {
            return $client->getClientSecret() === $client_secret;
        }

        return false;
    }
public function checkClientCredentials ( $ client_id , $ client_secret = null ) { // Get Client $ client = $ this -> em -> getRepository ( 'OAuth2ServerBundle:Client' ) -> find ( $ client_id ) ; // If client exists check secret if ( $ client ) { return $ client -> getClientSecret ( ) === $ client_secret ; } return false ; }
Make sure that the client credentials is valid.

@param $client_id
Client identifier to be check with.
@param $client_secret
(optional) If a secret is required, check that they've given the right one.

@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

@ingroup oauth2_section_3
Make sure that the client credentials is valid .