Note that there are some explanatory texts on larger screens.

plurals
  1. PO'Bad credentials' with Symfony2 authentication custom provider
    primarykey
    data
    text
    <p>I have a project with simple authentication by mysql database with username and password. I have simple form for authentication with 3 fields: pass, user and yubico key. I want to have two variants of authentication: by login+pass and by only <a href="http://www.yubico.com/" rel="nofollow">yubico key</a>. Now I created custom Authentication Provider by tutorial in <a href="http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html" rel="nofollow">this topic</a>.</p> <p>As a result, it does not work. I get this error log:</p> <blockquote> <p>exception 'Symfony\Component\Security\Core\Exception\BadCredentialsException' with message 'Bad credentials' in E:\Dropbox\hmciAdmin\vendor\symfony\symfony\src\Symfony\Component\Security\Core\Authentication\Provider\UserAuthenticationProvider.php:70 Stack trace: #0 E:\Dropbox\hmciAdmin\app\cache\dev\classes.php(183): session_start() #1 E:\Dropbox\hmciAdmin\app\cache\dev\classes.php(277): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()</p> </blockquote> <p>My code here:</p> <ul> <li><a href="https://dl.dropbox.com/u/30086473/Authentication/Firewall/YubicoListener.php" rel="nofollow">https://dl.dropbox.com/u/30086473/Authentication/Firewall/YubicoListener.php</a></li> <li><a href="https://dl.dropbox.com/u/30086473/Authentication/Provider/YubicoProvider.php" rel="nofollow">https://dl.dropbox.com/u/30086473/Authentication/Provider/YubicoProvider.php</a></li> <li><a href="https://dl.dropbox.com/u/30086473/Authentication/Token/YubicoToken.php" rel="nofollow">https://dl.dropbox.com/u/30086473/Authentication/Token/YubicoToken.php</a></li> <li><a href="https://dl.dropbox.com/u/30086473/Authentication/Token/config/services.yml" rel="nofollow">https://dl.dropbox.com/u/30086473/Authentication/Token/config/services.yml</a></li> <li><a href="https://dl.dropbox.com/u/30086473/Authentication/Token/config/config/security.yml" rel="nofollow">https://dl.dropbox.com/u/30086473/Authentication/Token/config/config/security.yml</a></li> </ul> <p><strong>UPDATE:</strong></p> <ul> <li><a href="https://dl.dropbox.com/u/30086473/YubicoFactory.php" rel="nofollow">https://dl.dropbox.com/u/30086473/YubicoFactory.php</a> - here Factory</li> </ul> <p><strong>UPDATE 2:</strong></p> <p>I solve this problem. The problem was that I used the same html form for both types of authorizations, but it was necessary to send yubico key to url of the page that is being protected. Now all work. Thanks all for help.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload