src/Majora/Component/OAuth/Server/Server.php
protected function createLoginAttempt(array $data, array $headers, array $query)
    {
        // validate grant_type manually (needed to guess specialized option resolver)
        if (empty($data['grant_type'])) {
            throw new \InvalidArgumentException('Any grant_type given.');
        }
        $grantType = $data['grant_type'];
        if (!$this->grantExtensions->containsKey($grantType)) {
            throw new \InvalidArgumentException('Given grant_type is invalid.');
        }

        // create option resolver
        $requestResolver = new OptionsResolver();
        $requestResolver->setRequired(array(
            'client_secret',
            'client_api_key',
            'grant_type',
        ));
        $this->grantExtensions->get($grantType)
            ->configureRequestParameters($requestResolver)
        ;

        return new LoginAttempt(
            $query,
            $requestResolver->resolve($data),
            $headers
        );
    }
protected function createLoginAttempt(array $data, array $headers, array $query)
    {
        // validate grant_type manually (needed to guess specialized option resolver)
        if (empty($data['grant_type'])) {
            throw new \InvalidArgumentException('Any grant_type given.');
        }
        $grantType = $data['grant_type'];
        if (!$this->grantExtensions->containsKey($grantType)) {
            throw new \InvalidArgumentException('Given grant_type is invalid.');
        }

        // create option resolver
        $requestResolver = new OptionsResolver();
        $requestResolver->setRequired(array(
            'client_secret',
            'client_api_key',
            'grant_type',
        ));
        $this->grantExtensions->get($grantType)
            ->configureRequestParameters($requestResolver)
        ;

        return new LoginAttempt(
            $query,
            $requestResolver->resolve($data),
            $headers
        );
    }
protected function createLoginAttempt ( array $ data , array $ headers , array $ query ) { // validate grant_type manually (needed to guess specialized option resolver) if ( empty ( $ data [ 'grant_type' ] ) ) { throw new \ InvalidArgumentException ( 'Any grant_type given.' ) ; } $ grantType = $ data [ 'grant_type' ] ; if ( ! $ this -> grantExtensions -> containsKey ( $ grantType ) ) { throw new \ InvalidArgumentException ( 'Given grant_type is invalid.' ) ; } // create option resolver $ requestResolver = new OptionsResolver ( ) ; $ requestResolver -> setRequired ( array ( 'client_secret' , 'client_api_key' , 'grant_type' , ) ) ; $ this -> grantExtensions -> get ( $ grantType ) -> configureRequestParameters ( $ requestResolver ) ; return new LoginAttempt ( $ query , $ requestResolver -> resolve ( $ data ) , $ headers ) ; }
Validate given request parameters and build a
LoginAttempt object with it.

@param array $data
@param array $headers
@param array $query

@return LoginAttempt
Validate given request parameters and build a LoginAttempt object with it .