for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Eljam\GuzzleJwt\Strategy\Auth;
use Symfony\Component\OptionsResolver\OptionsResolver;
/**
* @author Guillaume Cavana <[email protected]>
*/
class FormAuthStrategy extends AbstractBaseAuthStrategy
{
* {@inheritdoc}
public function configureOptions(OptionsResolver $resolver)
parent::configureOptions($resolver);
$resolver->setDefaults([
'form_fields' => ['_username', '_password'],
]);
$resolver->setRequired(['form_fields']);
}
public function getRequestOptions()
return [
\GuzzleHttp\RequestOptions::FORM_PARAMS => [
$this->options['form_fields'][0] => $this->options['username'],
$this->options['form_fields'][1] => $this->options['password'],
],
];