I have an issue using escapewsseauthenticationbundle to secure my API (using FOSRestBundle and FOSUserBundle). With my security.yml, the login always failed and return a 401 status code.
I'm using chrome rest console and Teria's wsse header generator to authenticate and access my resource.
app/security.yml
encoders:
FOS\UserBundle\Model\UserInterface: sha512
providers:
fos_userbundle:
id: fos_user.user_provider.username
wsse_secured:
pattern: ^/api/.*
wsse:
lifetime: 300 #lifetime of nonce
realm: "Secured API" #identifies the set of resources to which the authentication information will apply (WWW-Authenticate)
profile: "UsernameToken" #WSSE profile (WWW-Authenticate)
encoder: #digest algorithm
algorithm: sha512
encodeHashAsBase64: true
iterations: 1
anonymous: true
provider: fos_userbundle
access_control:
- { path: ^/api.*, role: ROLE_USER }
- { path: ^/, role: ROLE_USER }
Anybody know how to fix it ?
Thanks !