Ejemplo n.º 1
0
 public function testEraseCredentials()
 {
     $token = new RunAsUserToken('foo', 'foo', 'secret', array(), $this->getMock('Symfony\\Component\\Security\\Core\\Authentication\\Token\\TokenInterface'));
     $this->assertEquals('secret', $token->getCredentials());
     $token->eraseCredentials();
     $this->assertNull($token->getCredentials());
 }
 protected function restoreOriginalToken(RunAsUserToken $runAsToken)
 {
     if (null !== $this->logger) {
         $this->logger->debug('Populating security context with original Token.');
     }
     $this->securityContext->setToken($runAsToken->getOriginalToken());
 }
 /**
  * Restores the original user token.
  *
  * @param RunAsUserToken $runAsToken
  */
 private function restoreOriginalToken(RunAsUserToken $runAsToken)
 {
     if (null !== $this->logger) {
         $this->logger->debug('Populating TokenStorage with original Token.');
     }
     $this->tokenStorage->setToken($runAsToken->getOriginalToken());
 }