[Flow] CSRF Token

Steffen Wickham steffen at gaming-inc.de
Tue Apr 22 14:46:46 CEST 2014


Hello Ali,

you have to inject the security context to your controller by adding
folling code.
    /**
     * @var \TYPO3\Flow\Security\Context
     * @Flow\Inject
     */
    protected $securityContext;

After injection, you can get the CSRF Token by calling
$this->securityContext->getCsrfProtectionToken(); within your method.

Cheers
Steffen



Am 22.04.14 14:16, schrieb Ali Reza Sajedi:
> Good day,
>
> How do I get the CSRF Token in a controller?
>
> I need this to be passed with JSON-Object to a form which gets created
> by javascript.
>
> Thank you.
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow



More information about the Flow mailing list