Symfony2 and Uploadify: security token is not supported

I am trying to get Symfony2 and Uploadify to work together in a secure area. (Uploadify is a flash / javascript component used to upload multiple files)

My uploadize component works fine when the script outline is outside a protected area, but when in this area I get an HTTP HTTP 302 error.

Log message:

security.INFO: Authentication exception occurred; redirecting to authentication entry point (A Token was not found in the SecurityContext.) 

While searching for an answer, I found that passing PHPSESSID to the inside of the script as the post parameter should work on "non-framework php", but with the help of the Symfony Security Component it seems that this script has not even been reached.

Does anyone know if there is a way to send this token to an external script while keeping this script in a protected area?

+4
source share
1 answer

After reading the Symfony website, it is possible that this solution may work (did not test it). In the security.yml file, change the access_contol configuration access_contol to something like this ...

 access_control: - { path: ^/path/to/flash_component, roles: IS_AUTHENTICATED_ANONYMOUSLY } 

Where / path / to / flash_component is the URL that you upload to Uploadify. Let me know if this works.

+2
source

Source: https://habr.com/ru/post/1380552/


All Articles