[FLOW3-general] Authentication process

Federico Bernardin typo3list at bernardin.it
Mon Sep 24 09:13:45 CEST 2012


Hi guys,
I have just created my first authentication process, using PersistedUsernamePasswordProvider.
I created a controller that extends AuthenticationController, an action and its templates named login and in the template put the code from online manual:
<form action="/firsttest/standard/authenticate" method="post" name="loginform">
                <input type="text" id="username"
                        name="__authentication[TYPO3][FLOW3][Security][Authentication][Token][UsernamePassword][username]"
                        value="" tabindex="1" />
                <input type="password" id="password"
                        name="__authentication[TYPO3][FLOW3][Security][Authentication][Token][UsernamePassword][password]"
                        value="" tabindex="2" />
                <input type="submit" value="Login" tabindex="3" />
            </form>

Then I created a template for authenticate action but FLOW3 always write:

authenticateAction

Wrong credentials.

Before I created a user with this code:
public function newaccountAction(){
        $identifier = 'test';
        $password = 'test';
        $roles = array('Administrator');
        $authenticationProviderName = 'DefaultProvider';

        $account = $this->accountFactory->createAccountWithPassword($identifier, $password, $roles, $authenticationProviderName);
        $this->accountRepository->add($account);

        // add a message and redirect to the login form
            //$this->flashMessageContainer->addMessage('Account created. Please login.');
        $this->redirect('index');
    }

And there is the account into db.

In settings I wrote:
 security:
      authentication:
       # authenticationStrategy: oneToken
        providers:
          DefaultProvider:
            provider: PersistedUsernamePasswordProvider


What am I doing wrong?

Thanks
Federico


More information about the FLOW3-general mailing list