Merge pull request #164 from kapitchi/state-as-param
state param for AbstractProvider::getAuthorizationUrl()1.0
commit
16fa21c0fb
|
@ -85,7 +85,7 @@ abstract class AbstractProvider implements ProviderInterface
|
|||
|
||||
public function getAuthorizationUrl($options = array())
|
||||
{
|
||||
$this->state = md5(uniqid(rand(), true));
|
||||
$this->state = isset($options['state']) ? $options['state'] : md5(uniqid(rand(), true));
|
||||
|
||||
$params = array(
|
||||
'client_id' => $this->clientId,
|
||||
|
|
|
@ -33,4 +33,12 @@ class AbstractProviderTest extends \PHPUnit_Framework_TestCase
|
|||
$grant = new \StdClass;
|
||||
$this->provider->getAccessToken($grant, array('invalid_parameter' => 'none'));
|
||||
}
|
||||
|
||||
public function testAuthorizationUrlStateParam()
|
||||
{
|
||||
$this->assertContains('state=XXX', $this->provider->getAuthorizationUrl([
|
||||
'state' => 'XXX'
|
||||
]));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue