fosuserbundle

Symfony 2 FOSUserBundle with rest login and registration

落花浮王杯 提交于 2019-12-02 21:19:49
I have gone through lots of stackoveflow question and articles, but can't find a suitable answer. I'm using fosuserbundle, hwiouthbundle and lexikjwt bundle. I'm developing an api based on symfony which will be consumed by an android app and angular app. Now I need the register and login system with fosuserbundle facebook login with hwiouthbundle and api protection with lexikjwt bundle. I have implemented fosuserbundle and hwiouthbundke and both working without even writing user controller. But I need this with rest not with form. But I can't out type : rest in router. Now how can I login,

Creating a new user with FOSUserBundle fails

◇◆丶佛笑我妖孽 提交于 2019-12-02 19:58:34
I am trying to create a new user from the command line and get this error: Warning: array_search() expects parameter 2 to be array, null given in /vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Model/User.php line 368 When trying to create a user by registering over the webinterface I get this: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'salt' cannot be null Logging in with an already existing user works. Also updating a profile and changing the password. Just creating new users doesn't work. I am using v 1.3.1 in a very plain setup and haven't found any solution yet. Any

How to set a login form for admins and another for other users using FOSUserBundle?

好久不见. 提交于 2019-12-02 17:20:42
When having a backend for admin users, it is interesting to have a login form, and at the same time having a normal login form for normal users in the public area of our website. Is that possible using FOSUserBundle? How can it be done "the Symfony2" way? First we need to configure some special routes for the admin area: admin_login: pattern: /admin/login defaults: { _controller: FOSUserBundle:Security:login } admin_login_check: pattern: /admin/login_check defaults: { _controller: FOSUserBundle:Security:check } admin_logout: pattern: /admin/logout defaults: { _controller: FOSUserBundle

How to override the layout of the FosUser registration form layout.

只谈情不闲聊 提交于 2019-12-02 16:48:20
问题 How can I override the layout of the registration form Currently the form is -username -email -password -verification I want the override the layout of this form, lets say, two questions per row -username -email additional text -password -verification I understand how to write the views (twigs) register.html.twig calls register_content.html.twig which uses; {{ form_widget(form) }} how do i override the {{ form_widget(form) }} ? 回答1: You have to override FosUserBundle registration form

Dynamically Styling an FOS UserBundle Login Page

删除回忆录丶 提交于 2019-12-02 12:14:32
问题 I am relatively new to Symfony 2 but I have a site with many different sub domains and user areas that I would like my login page styled differently, but currently it is not. I am using Symfony 2 and the FOS UserBundle and everything is currently working properly with 1 firewall in security.yml. I a overriding the FOS UserBundle Layout per the documentation, but I would like to be able to style that page differently depending on where the request is coming from, for example: microsite1

Symfony Server crashes when extending FOSUserBundle's default template layout.html.twig

流过昼夜 提交于 2019-12-02 07:52:30
问题 I am trying to get the basic user login running from the FOSUserBundle. I am using Symfony 3.0.6. I followed the description to setup everything from the FOSUserBundle: https://symfony.com/doc/master/bundles/FOSUserBundle/index.html DB is up and running everything seems fine except I cant figure out how to override the layout.html.twig from the FOSUserBundle. I followed this description for achieving that: https://symfony.com/doc/master/bundles/FOSUserBundle/overriding_templates.html I now

Dynamically Styling an FOS UserBundle Login Page

爱⌒轻易说出口 提交于 2019-12-02 05:13:09
I am relatively new to Symfony 2 but I have a site with many different sub domains and user areas that I would like my login page styled differently, but currently it is not. I am using Symfony 2 and the FOS UserBundle and everything is currently working properly with 1 firewall in security.yml. I a overriding the FOS UserBundle Layout per the documentation, but I would like to be able to style that page differently depending on where the request is coming from, for example: microsite1.mainsite.com/user gets Style A microsite1.mainsite.com/admin gets Style B microsite2.mainsite.come/user gets

Symfony Server crashes when extending FOSUserBundle's default template layout.html.twig

老子叫甜甜 提交于 2019-12-02 03:30:23
I am trying to get the basic user login running from the FOSUserBundle. I am using Symfony 3.0.6. I followed the description to setup everything from the FOSUserBundle: https://symfony.com/doc/master/bundles/FOSUserBundle/index.html DB is up and running everything seems fine except I cant figure out how to override the layout.html.twig from the FOSUserBundle. I followed this description for achieving that: https://symfony.com/doc/master/bundles/FOSUserBundle/overriding_templates.html I now have a file "layout.html.twig" in the folder "Resources/FOSUserBundle/views" with the content being the

How to access the user Token in an injected service to reencode passwords?

倖福魔咒の 提交于 2019-12-01 22:42:42
I have the below code where I am trying to re-encode passwords as users log in (the database has bee migrated form a legacy website). However, I'm not sure what I'm doing wrong as I keep getting errors: Attempted to call an undefined method named "forward" of class "AppBundle\Service\HubAuthenticator". I have set things up as follows: security.yml security: encoders: AppBundle\Entity\Member: id: club.hub_authenticator services.yml services: //This should be central service than then calls the second club.hub_authenticator: class: AppBundle\Service\HubAuthenticator club.password_rehash: class:

Symfony2 FOSUserBundle extending registration form causes duplicate email to validate

牧云@^-^@ 提交于 2019-12-01 09:39:21
I have a custom registration form type defined like this: .... public function buildForm(FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); $builder ->remove('username') ->add('firstName') ->add('lastName') ->add('hei', 'entity', array( 'class' => 'AcmeAcmeBundle:HigherEducationalInstitution', 'label' => 'Higher Educational Institution' )); } .... The custom controller works pretty much the same as the one in the FOSUserbundle and also checks for a valid form ... public function registerAsStudentAction(Request $request) { /** @var $formFactory \FOS