First of all, lose the controller argument on your security check
route. There is no "checkAction" needed.  Symfony handles checking the
password and forwarding to the appropriate route.

If you're using form authentication you need a textfield named
"_username" and one named "_password".  The "action" for your form
should be the "check_path" specified in your configuration.  If you
don't specify one "/login/check" is the default I think.

What UserProvider are you using?  I'm set up using Doctrine Entity and
can help you further with that for sure.

Some more insight into your configuration would help me help you
better.

Cheers.

Roger

On Mar 4, 7:51 am, Donald <chekot...@gmail.com> wrote:
> Here's some more info on what I'm trying to accomplish:
>
> #UserBundle/Resources/config/routing.yml
> _security_login:
>   pattern:  /login
>   defaults: { _controller: UserBundle:Security:login }
>
> _security_check:
>   pattern:  /login_check
>   defaults: { _controller: UserBundle:Security:check }
>
> #UserBundle/Controller/SecurityController.php
> class SecurityController extends Controller {
>
>   public function loginAction($_format) {
>     $request = $this->get('request');
>
>     if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
>
>       $error = 
> $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
>
>     } else {
>       $error = 
> $request->getSession()->get(SecurityContext::AUTHENTICATION_ERROR);
>
>     }
>
>     return $this->render('UserBundle:user:login.' . $_format . '.php',
> array(
>       // last username entered by the user
>       '_username' => 
> $this->get('request')->getSession()->get(SecurityContext::LAST_USERNAME),
>
>       'error'    => $error,
>     ));
>   }
>
>   public function checkAction() {
>     // what goes here?
>   }
>
> }
>
> Do I even need the checkAction method? If so, how do I authenticate
> the user? If I don't need the checkAction method, how exactly do I
> authenticate a user?
>
> On Mar 3, 4:29 pm, Donald <chekot...@gmail.com> wrote:
>
> > Unfortunately the authentication docs there aren't updated at all.
>
> > So I'm still looking for advice...
>
> > On Mar 3, 3:18 pm, Donald <chekot...@gmail.com> wrote:
>
> > > I wasn't aware that was on github. I'll go check it out immediately.
>
> > > Thanks!
>
> > > On Mar 3, 3:07 pm, olimination <oliminat...@gmail.com> wrote:
>
> > > > Hi,
>
> > > > I sometimes use the master documentation on GitHub and there you find
> > > > some updated documentations:
>
> > > >https://github.com/symfony/symfony-docs
>
> > > > greets,
> > > > Oli
>
> > > > On Mar 3, 8:38 pm, Donald <chekot...@gmail.com> wrote:
>
> > > > > Hi,
>
> > > > > I'm working with the master branch of the Symfony 2 sandbox, and I'm
> > > > > trying to get user authentication to work. Obviously things have
> > > > > changed a great deal since the last preview release, so I'm hoping to
> > > > > get some pointers.
>
> > > > > I've managed to get everything setup to the point where I'm being
> > > > > redirected to the /login_check url. I got the impression from the
> > > > > Symfony Reloaded docs that I don't actually have to authenticate the
> > > > > user myself, and that it would be handled automatically by the
> > > > > framework. It doesn't seem to be working that way in practice though.
>
> > > > > Do I need to authenticate the user myself by implementing an action
> > > > > for the /login_check URL, and if so, how exactly do I do that?
> > > > > SecurityContext getUser() method doesn't seem to exist anymore, and
> > > > > I've been digging around the source code all day with no luck.
>
> > > > > Thank in advance for any help.
>
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to