src/GrantType/JwtBearer.php
protected function computeJwt()
    {
        $payload = [
            'iss' => $this->getConfig('client_id'),
            'aud' => rtrim($this->getConfig('base_uri'), '/'),
            'exp' => time() + 60 * 60,
            'iat' => time(),
            'sub' => '',
        ];

        if (isset($this->config['jwt_payload']) && is_array($this->config['jwt_payload'])) {
            $payload = array_replace($payload, $this->config['jwt_payload']);
        }

        $signer = $this->signerFactory($this->config['jwt_algorithm']);

        $privateKey = new Key(file_get_contents($this->config['jwt_private_key']), $this->config['jwt_private_key_passphrase']);

        $builder = $this->tokenBuilderFactory($payload);

        $token = $builder->sign($signer, $privateKey)
              ->getToken();

        return (string) $token;
    }
protected function computeJwt()
    {
        $payload = [
            'iss' => $this->getConfig('client_id'),
            'aud' => rtrim($this->getConfig('base_uri'), '/'),
            'exp' => time() + 60 * 60,
            'iat' => time(),
            'sub' => '',
        ];

        if (isset($this->config['jwt_payload']) && is_array($this->config['jwt_payload'])) {
            $payload = array_replace($payload, $this->config['jwt_payload']);
        }

        $signer = $this->signerFactory($this->config['jwt_algorithm']);

        $privateKey = new Key(file_get_contents($this->config['jwt_private_key']), $this->config['jwt_private_key_passphrase']);

        $builder = $this->tokenBuilderFactory($payload);

        $token = $builder->sign($signer, $privateKey)
              ->getToken();

        return (string) $token;
    }
protected function computeJwt ( ) { $ payload = [ 'iss' => $ this -> getConfig ( 'client_id' ) , 'aud' => rtrim ( $ this -> getConfig ( 'base_uri' ) , '/' ) , 'exp' => time ( ) + 60 * 60 , 'iat' => time ( ) , 'sub' => '' , ] ; if ( isset ( $ this -> config [ 'jwt_payload' ] ) && is_array ( $ this -> config [ 'jwt_payload' ] ) ) { $ payload = array_replace ( $ payload , $ this -> config [ 'jwt_payload' ] ) ; } $ signer = $ this -> signerFactory ( $ this -> config [ 'jwt_algorithm' ] ) ; $ privateKey = new Key ( file_get_contents ( $ this -> config [ 'jwt_private_key' ] ) , $ this -> config [ 'jwt_private_key_passphrase' ] ) ; $ builder = $ this -> tokenBuilderFactory ( $ payload ) ; $ token = $ builder -> sign ( $ signer , $ privateKey ) -> getToken ( ) ; return ( string ) $ token ; }
Compute JWT, signing with provided private key.
Compute JWT signing with provided private key .