public function createToken(Request $request, $providerKey)
    {
        $apiKey = $request->headers->get($this->header);

        if (!$apiKey) {
            throw new BadCredentialsException('No ApiKey found in request!');
        }

        return new PreAuthenticatedToken(
            'unauthorized',
            $apiKey,
            $providerKey
        );
    }
public function createToken(Request $request, $providerKey)
    {
        $apiKey = $request->headers->get($this->header);

        if (!$apiKey) {
            throw new BadCredentialsException('No ApiKey found in request!');
        }

        return new PreAuthenticatedToken(
            'unauthorized',
            $apiKey,
            $providerKey
        );
    }
public function createToken ( Request $ request , $ providerKey ) { $ apiKey = $ request -> headers -> get ( $ this -> header ) ; if ( ! $ apiKey ) { throw new BadCredentialsException ( 'No ApiKey found in request!' ) ; } return new PreAuthenticatedToken ( 'unauthorized' , $ apiKey , $ providerKey ) ; }
Creates an api key by the http request.

@param Request $request
@param string  $providerKey

@throws BadCredentialsException If the request token cannot be found

@return PreAuthenticatedToken
Creates an api key by the http request .