Expand my Community achievements bar.

SOLVED

CSRF token not available for the login AJAX POST request

Avatar

Level 2

We are upgrading from CQ 5.6 to 6.1, Our login POST AJAX request is failing due to invalid CSRF token. On Debugging we noticed that /libs/granite/csrf/token.json is returning a valid token only after successful CRX login otherwise it is returning an null value. So at the time of login, CSRF-Token is undefined and it is causing login post request to fail. Is there anyway to exempt the login post request alone from CSRF filter? or how can we fix this

1 Accepted Solution

Avatar

Correct answer by
Level 2

Thanks,

The "j_validate" field was missing in our login form, once we added it, it resolved the issue.

View solution in original post

3 Replies

Avatar

Level 10

See this Ask the AEM Community Experts - Justin - our AEM Evangelist cover this : 

https://helpx.adobe.com/experience-manager/using/secure_sites.html

See the link the webinar at the start of the article - in the table at the start of the article. 

Avatar

Correct answer by
Level 2

Thanks,

The "j_validate" field was missing in our login form, once we added it, it resolved the issue.