KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've written my own password encoder which implements the PasswordEncoderInterface : class BCryptPasswordEncoder implements PasswordEncoderInterface { protected $encoder; public function __construct(BCryptEncoder $encoder) { $this->encoder = $encoder; } public function encodePassword($raw, $salt) { return $this->encoder->encodeString($raw, $salt); } public function isPasswordValid($encoded, $raw, $salt) { return $this->encoder->encodeString($raw, $salt) == $encoded; } } The encoder is registered as a service with the id bcrypt.password.encoder . But I don't know, how to tell symfony to user it. Currently the app/config/security.yml looks like this: security: encoders: Symfony\Component\Security\Core\User\User: plaintext role_hierarchy: ROLE_ADMIN: ROLE_USER ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] providers: neo4j: id: security.user.provider.neo4j firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false secured_area: provider: neo4j pattern: ^/.* form_login: check_path: /login_check login_path: /login logout: path: /logout target: / anonymous: ~ access_control: - { path: ^/login, role: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/.*, role: ROLE_ADMIN } Btw I'm not using any doctrine entities. Edit : Symfony\Component\Security\Core\User\User is my UserObject. I modified the security.yml a bit: encoders: Symfony\Component\Security\Core\User\User: id: bcrypt.password.encoder which results in a fatal error:<
Tags (comma-separated)
Save Edits
Cancel