FosUserBundle
Forum rules
Always add your Symfony, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Symfony, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
FosUserBundle
Hey
I've managed to integrate the Symfony FosUserBundle (https://github.com/FriendsOfSymfony/FOSUserBundle) for registration, authentication and password reminder into my Aimeos Symfony project.
Are you also interested in using this in Aimeos instead of the current solution?
Regards,
Garret
I've managed to integrate the Symfony FosUserBundle (https://github.com/FriendsOfSymfony/FOSUserBundle) for registration, authentication and password reminder into my Aimeos Symfony project.
Are you also interested in using this in Aimeos instead of the current solution?
Regards,
Garret
Re: FosUserBundle
Hi Garret
Sure, every contribution is welcome!
Sure, every contribution is welcome!
Re: FosUserBundle
Hey
The necessary changes have been committed and as far as I can see, the tests for the core and the Symfony adapter succeed now.
There's a pull request for the Symfony bundle as well and it may require some more attention because I've only added the FosUser entity and that's no used by default.
Regards,
Garret
The necessary changes have been committed and as far as I can see, the tests for the core and the Symfony adapter succeed now.
There's a pull request for the Symfony bundle as well and it may require some more attention because I've only added the FosUser entity and that's no used by default.
Regards,
Garret
Re: FosUserBundle
The test are now working like expected
Garret
Garret
Re: FosUserBundle
Great! How does it work?
Maybe we can write some documentation for it.
Maybe we can write some documentation for it.
Re: FosUserBundle
I've used 2.0 branch of the FosUserBundle and I've added this to the require section of my composer.json:
In AppKernel::registerBundles() the bundle must be registered:
The config.yml needs these settings and I've used the secure Bcrypt encryption:
The user bundle routes must also be included in the routing.yml:
The security.yml is the most complex file:
Hope this helps.
Code: Select all
"friendsofsymfony/user-bundle": "~2.0@dev"
Code: Select all
new FOS\UserBundle\FOSUserBundle(),
Code: Select all
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: aimeos_myaccount
user_class: Aimeos\ShopBundle\Entity\FosUser
aimeos_shop:
classes:
customer:
manager:
name: FosUser
mshop:
customer:
manager:
password:
name: Bcrypt
Code: Select all
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
Code: Select all
security:
providers:
aimeos_customer:
entity: { class: AimeosShopBundle:FosUser, property: username }
encoders:
Aimeos\ShopBundle\Entity\FosUser: bcrypt
firewalls:
aimeos_myaccount:
pattern: ^/
form_login:
provider: aimeos_customer
csrf_provider: form.csrf_provider
logout: true
anonymous: true
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/myaccount, roles: ROLE_USER }