formapro / FpOpenIdBundle

Symfony2 OpenID security extension
53 stars 31 forks source link

approve_route #60

Closed penfold45 closed 11 years ago

penfold45 commented 11 years ago

Hi I used to have the following setup for this bundle

fp_open_id:                                                                                                                                                                                                                                                                     
    provider:                                                                                                                                                                                                                                                                   
        return_route:   'login_check'                                                                                                                                                                                                                                           
        roles:          [ROLE_USER]                                                                                                                                                                                                                                             
        approve_route:  'openid_approve_user'                                                                                                                                                                                                                                   
        cancel_route:   'openid_approve_user

i.e I was using "approve_route" in order to do an extra check on an external database to see if the user existed on that database (its an api call not a database connection in the system)

I am in the process of upgrading to Symfony 2.1 and also to master branch of this Bundle how can I mimic the old approve_route functionality it appears to have been removed.

Thanks

makasim commented 11 years ago

This logic described in this doc: https://github.com/formapro/FpOpenIdBundle/blob/master/Resources/doc/interactive_user_creation.md

You have to use failure_path.

penfold45 commented 11 years ago

brilliant thank you ill give it a go.

penfold45 commented 11 years ago

Hi thanks that worked however In the Controller is used to do

$this->container->get('security.context')->setToken(new OpenIdToken())

then

return $this->redirect($this->generateUrl('login_check', array('openid_approved' => 1)));

To authenticate. This does not appear to be working the token looks fine but I get

No identity supplied.

from

vendor/fp/lightopenid/openid.php at line 405
makasim commented 11 years ago

closing. if you still have some question reopen it