fosuserbundle

What is preventing passwords being rehashed with the injected Symfony services (FOSUserBundle)

对着背影说爱祢 提交于 2019-12-23 16:27:34
问题 This is a follow up question to my original question where I am trying to rehash user passwords during authentication to migrate from a legacy database. After implementing the helpful answer there. I have now hit another problem where I receive no error (with the below code) but the passwords and salt are not being updated in the database: security.yml security: encoders: AppBundle\Entity\Member: id: club.hub_authenticator services.yml services: club.hub_authenticator: class: AppBundle

Cannot autowire service

我是研究僧i 提交于 2019-12-23 12:17:36
问题 I am trying to implement UserManager from FOSUserBundle (Symfony3.4). Service/Register.php <?php namespace AppBundle\Service; use FOS\UserBundle\Model\UserManager; class Register { private $userManager; public function __construct(UserManager $userManager) { $this->userManager = $userManager; } public function register() { $user = $this->userManager->findUserByUsernameOrEmail('aaa@gmail.clom'); if($user){ return false; } return true; } } When I try call this method I get: Cannot autowire

Select count() in Doctrine DQL with left join manyToMany unidirectional relation where user does NOT have relation specific group

最后都变了- 提交于 2019-12-23 09:04:32
问题 Situaction: I am trying to select count() in DQL for users NOT in specific group. Standard ManyToMany unidirectional relation between User and Group entities from FOSUserBundle (and SonataUserBundle ). System: Symfony 2.5, Doctrine 2.4. Entity User P.S. this is not real code copied. It is not possible because there are several layers extending with different config files in different formats and places, so if you spot mistype, this is not the problem. namespace RAZ\UserBundle\Entity; /** *

Symfony - FOS UserBundle Error: “Attempted to load class 'User' from namespace…” by opening the /register Page

混江龙づ霸主 提交于 2019-12-23 06:09:04
问题 I'd like to use the Fos UserBundle in Symfony. I've configure it like "Getting Started With FOSUserBundle" from Symfony Doc. The /Login Page is working but when I open the /register Page I get the Error: Attempted to load class "User" from namespace "AppBundle\Entity". Did you forget a "use" statement for e.g. "Symfony\Component\Security\Core\User\User", "Symfony\Bridge\Doctrine\Tests\Fixtures\User" or "FOS\UserBundle\Model\User"? 500 Internal Server Error - ClassNotFoundException Stack Trace

Symfony - FOS UserBundle Error: “Attempted to load class 'User' from namespace…” by opening the /register Page

*爱你&永不变心* 提交于 2019-12-23 06:07:24
问题 I'd like to use the Fos UserBundle in Symfony. I've configure it like "Getting Started With FOSUserBundle" from Symfony Doc. The /Login Page is working but when I open the /register Page I get the Error: Attempted to load class "User" from namespace "AppBundle\Entity". Did you forget a "use" statement for e.g. "Symfony\Component\Security\Core\User\User", "Symfony\Bridge\Doctrine\Tests\Fixtures\User" or "FOS\UserBundle\Model\User"? 500 Internal Server Error - ClassNotFoundException Stack Trace

how to get session value inside symfony2 i use fosuserbundle

ぐ巨炮叔叔 提交于 2019-12-23 02:48:07
问题 i'm using fosuserbundle and this is my function inside FOSUBUserProvider class : public function connect(UserInterface $user, UserResponseInterface $response) { // and here i want to get session value like: $session = $request->getSession(); $session->get('value1'); // } 回答1: you need to inject Session in your Services Declaration, and then add it in constructor of FOSUserProvider class, in services.yml and services section add @session parameters: my_user_provider.class: Auth\UserBundle

how to overriding fosuserbundle registration form style

拈花ヽ惹草 提交于 2019-12-22 18:15:17
问题 I want to use bootstrap style apply in fosuserbundle registration form.and the login cant overriding,but because of registration form use "{{ form_widget(form) }}",so I can't overriding it,I use symfony2.2,I also test use form theme,like this {% block form_row %} {% spaceless %} <div class="control-group"> {{ form_label(form, label|default(null),{ 'attr': {'class': 'control-label'} }) }} {{ form_errors(form) }} <div class="controls">{{ form_widget(form) }}</div> </div> {% endspaceless %} {%

Symfony2 OAuth keeps giving me a login page when a token is provided

淺唱寂寞╮ 提交于 2019-12-22 17:49:27
问题 I have setup an app with: FriendsOfSymfony/FOSUserBundle FriendsOfSymfony/FOSOAuthServerBundle FriendsOfSymfony/FOSRestBundle I have successfully created a client and can get an access token using a url like this http://api.mydomain.com/oauth/v2/token?client_id=CLIENT_ID&client_secret=CLIENT_SECRET&grant_type=password&username=mikebates&password=secret However, when I then try to access the a url like this http://api.mydomain.com/api/surgeries/45/details?access_token=ACCESS_TOKEN I get

Unrecognized field: facebookId

蹲街弑〆低调 提交于 2019-12-22 13:34:26
问题 I try to connect symfony 3 with HWIOAUTH Bundle and follow the tutorial https://gist.github.com/danvbe/4476697. file config.yml hwi_oauth: connect: account_connector: my_user_provider firewall_names: [main] fosub: username_iterations: 30 properties: google: googleId facebook: facebookId resource_owners: facebook: type: facebook client_id: *************** client_secret: *************** scope: "" google: type: google client_id: *************** client_secret: *************** scope: "https://www

Symfony 2 - Adding user roles under the ROLE_USER

与世无争的帅哥 提交于 2019-12-22 10:29:57
问题 I'm trying to create a new role in Symfony 2 below the default USER_ROLE (that role would have limited write access to some features). I am using FOSUserBundle. I've written the following security settings so far but my ROLE_DEMO users still get the ROLE_USER. role_hierarchy: ROLE_DEMO: [] ROLE_USER: [ROLE_DEMO] ROLE_ADMIN: [ROLE_USER, ROLE_SONATA_ADMIN] ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] Is it possible to create a role under the ROLE_USER in Symfony 2. If yes,