You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new with symfony, and i have a problem with the framework, I'm using the LexikJWTAuthenticationBundle with the fosuserbundle, and when I try to get the token via the curl -X POST curl -X POST http://test2.local/api/login_check -d _username=anas -d _password=anas or when I try to login via the form I get this json :
{"code":401,"message":"Bad credentials"}
When it works good with the fosuserbundle alone but when i added the LexikJWTAuthenticationBundle, it returns the 401 code.
I think it's due to some bad configuration in my config file so here is my config file:
app/config/config.yml
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: api
user_class: StageOCP\UserBundle\Entity\User
registration:
form:
type: acme_user_registration
confirmation:
from_email:
address: ---
sender_name: ---
enabled: true
resetting:
email:
from_email: # Use this node only if you don't want the global email address for the resetting email
address: ---
sender_name: ---
service:
mailer: fos_user.mailer.twig_swift
Hi,
I'm new with symfony, and i have a problem with the framework, I'm using the LexikJWTAuthenticationBundle with the fosuserbundle, and when I try to get the token via the curl -X POST curl -X POST http://test2.local/api/login_check -d _username=anas -d _password=anas or when I try to login via the form I get this json :
{"code":401,"message":"Bad credentials"}
When it works good with the fosuserbundle alone but when i added the LexikJWTAuthenticationBundle, it returns the 401 code.
I think it's due to some bad configuration in my config file so here is my config file:
app/config/config.yml
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: api
user_class: StageOCP\UserBundle\Entity\User
registration:
form:
type: acme_user_registration
confirmation:
from_email:
address: ---
sender_name: ---
enabled: true
resetting:
email:
from_email: # Use this node only if you don't want the global email address for the resetting email
address: ---
sender_name: ---
service:
mailer: fos_user.mailer.twig_swift
lexik_jwt_authentication:
private_key_path: %jwt_private_key_path%
public_key_path: %jwt_public_key_path%
pass_phrase: %jwt_key_pass_phrase%
token_ttl: %jwt_token_ttl%
and here is my routing file:
app/config/routing.yml
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
fos_user_security_check:
path: /api/login_check
defaults: { _controller: FOSUserBundle:Security:check }
fos_js_routing:
resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"
api_login_check:
path: /api/login_check
and here is my security file:
app/config/security.yml
security:
encoders:
FOS\UserBundle\Model\UserInterface: sha512
and here is my vhost conf :
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.)
RewriteRule . - [e=HTTP_AUTHORIZATION:%1]
DocumentRoot "C:\wamp\www\Test2\web"
ServerName test2.local
ServerAlias test2.local
ErrorLog "logs/siteA.localhost-error.log"
CustomLog "logs/siteA.localhost-access.log" common
Alias /sf C:\wamp\www\Test2\lib\vendor\symfony\data\web\sf
The text was updated successfully, but these errors were encountered: