fosuserbundle

Symfony2 FOSUserBundle not setting authenticated user to session?

放肆的年华 提交于 2019-12-12 10:16:09
问题 I have a very basic Symfony2.1 setup with FOSUserBundle installed. When registering all is well and I am redirected to my target path and the debug bar shows that I am authenticated as myself. When logging in however, submitting the form with bad creds will reflect as such, but if I login with the correct creds, I get redirected to my target path but I'm still anon, so authentication is successful but not persisted in the session. Am I missing something? I have followed the basic

set role for users in edit form of sonata admin

微笑、不失礼 提交于 2019-12-12 09:46:25
问题 I'm using Symfony 2.1 for a project. I use the FOSUserBundle for managing users & SonataAdminBundle for administration usage. I have some questions about that: As an admin, I want to set roles from users in users edit form. How can I have access to roles in role_hierarchy ? And how can I use them as choice fields so the admin can set roles to users? When I show roles in a list, it is shown as string like this: [0 => ROLE_SUPER_ADMIN] [1 => ROLE_USER] How can I change it to this? ROLE_SUPER

FOSUserBundle/Symfony2: Force logout of a user given a user (not the currently logged in user)

人盡茶涼 提交于 2019-12-12 09:43:31
问题 Whenever I edit a user's role, the user needs to logout and log back in to see the changes. There's no problem when promoting a user as they just won't see the extra permissions until signing in again. However, when a demotion was to occur, a user will still keep its existing role which impose security risks. Imagine revoking admin user on a rogue employee, and still have them be able to do anything (eg. sabotaging the system) until they log out! Is it possible to invalidate all sessions or

FOSUserBundle not found in appkernel

回眸只為那壹抹淺笑 提交于 2019-12-12 08:11:41
问题 I am using symfony on Windows and I tried to configure FOSUserBundle as described in the official documentation. I get this error when try to update the schema: Class 'FOS\UserBundle\FOSUserBundle' not found in app/AppKernel.php line 20; searched for the problem and find this solution: adding this to autoload.php $loader->registerNamespaces(array( //all the rest 'FOS' => $vendor_dir . '/bundles', )); but it returns another error which says call to undefined method ...\ClassLoader:

RegistrationFormType::buildForm() not compatible

杀马特。学长 韩版系。学妹 提交于 2019-12-12 08:07:16
问题 I just upgrade my Symfony 2.0.12 project to 2.1. I also installed FosUserBundle, but when I run command php composer.phar update then composer output an error: Loading composer repositories with package information Updating dependencies Writing lock file Generating autoload files PHP Fatal error: Declaration of User\UserBundle\Form\Type\RegistrationFormType::buildForm() must be compatible with that of Symfony\Component\Form\FormTypeInterface::buildForm() in /home/mark/dev/proj/src/User

What is the issue with not overriding templates in symfony2.6 and FOSUserBundle 1.3

二次信任 提交于 2019-12-12 06:15:45
问题 I'm trying to override the base layout of FOSUserBundle using the 'simple' option of making a cloned path as .app/Resources/FOSUserBundle/views/layout.html.twig , but symfony2.6 continues to render the template from inside the vendor directory. My composer requires: "require": { "php": ">=5.3.3", "symfony/symfony": "2.6.*", "doctrine/orm": "~2.2,>=2.2.3,<2.5", "doctrine/dbal": "<2.5", "doctrine/doctrine-bundle": "~1.2", "twig/extensions": "~1.0", "symfony/assetic-bundle": "~2.3", "symfony

FOSUserBundle + HWIOAuth security configuration failed

孤街醉人 提交于 2019-12-12 05:38:54
问题 I'm trying to get FOSUserBundle and HWIOAuth working together for handle the authentication of two types of users: representatives and interns. The representatives ones would begin using HWIOAuth and would use Salesforce and internal FOSUserBundle. I'm trying to set everything but I have problems because Symfony throws this error when I try to access the /login-salesforce or /admin routes. InvalidConfigurationException in BaseNode.php line 313: Invalid configuration for path "security

Is there a 'passive' way to implement a new hashing method for users passwords?

自作多情 提交于 2019-12-12 05:04:07
问题 I have an old site which I have reworked using Symfony3 and FOSUserBundle and am trying to work out the logistics of how to map the database over without having to cause problems for all the users. The 'old' site hashes the passwords before storing with: sha1("$salt1$pass$salt2") The 'new' site (using FOSUserBundle) uses it's default method of Bcrypt somewhere within the bundle. Is the below the correct way to "Bcrypt" members plaintext passwords in the database as they log in? Temporarily

Symfony2 functional test with Session and Post

喜你入骨 提交于 2019-12-12 04:56:31
问题 I am trying to write some Symfony2 functional tests, using PHPUnit, that simulate a logged-in user requesting some resource via an AJAX call. The test first simulates a user logging-in using the standard FOSUserBundle log-in form; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class MyWebTestCase extends WebTestCase { public function login($username, $password = 'password') { $client = static::createClient(); $client->followRedirects(true); $crawler = $client->request('GET', '/login');

FOSUserBundle ignore password field

巧了我就是萌 提交于 2019-12-12 04:33:53
问题 So I'm using the FOSUserBundle with LDAP as my authentication method, and I'm wondering whether there is a way to remove/ignore the password field for my FOSUser entity? I realize removal might not be ideal (in case it messes with internal logic), but the column is never used, and I'm forced to fill it when I'm creating FOSUsers from fixtures: $user = new FOSUser(); $user->setDn($item["dn"]); $user->setEnabled(1); $user->setUsername($item["samaccountname"][0]); $user->setUsernameCanonical