KnpU\OAuth2ClientBundle\Client\OAuth2Client::setAsStateless PHP Method

setAsStateless() public method

Call this to avoid using and checking "state".
public setAsStateless ( )
    public function setAsStateless()
    {
        $this->isStateless = true;
    }

Usage Example

 public function testGetAccessTokenFromPOST()
 {
     $this->request->request->set('code', 'CODE_ABC');
     $expectedToken = $this->prophesize('League\\OAuth2\\Client\\Token\\AccessToken');
     $this->provider->getAccessToken('authorization_code', ['code' => 'CODE_ABC'])->willReturn($expectedToken->reveal());
     $client = new OAuth2Client($this->provider->reveal(), $this->requestStack);
     $client->setAsStateless();
     $actualToken = $client->getAccessToken();
     $this->assertSame($expectedToken->reveal(), $actualToken);
 }
All Usage Examples Of KnpU\OAuth2ClientBundle\Client\OAuth2Client::setAsStateless