Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

Custom Login Page CSRF issue

Avatar

Level 1

Hi,

I have implemented custom login page similar to forum question AEM 6.1 - Login Background Image for AEM version 6.3

After enabling this I am facing issue while login to AEM. It shows following error at client side:

Uncaught DOMException: Failed to execute 'send' on 'XMLHTTPRequest' : Failed to load https://myaemdomain.com/libs/granite/csrf/token.json

Any suggestions to resolve this issue?

Thanks!

6 Replies

Avatar

Level 10

Something in your component is most likely not setup properly.

We have a 6.3 login article. This issue has not appeared in that artilce:

Creating a Login Component for the Experience Manager Toy Store

Avatar

Level 1

I hope you are facing this issue on publish instance and not on author. For making any ajax call on publish instance aem needs csrf token.

Can you try adding  granite.csrf.standalone clientlibrary  category to your clientlibs. This client libs generates the csrf token on publish when you are not logged in.

Please give it a try and let me know if you still face any issue.

Avatar

Level 1

Thanks for quick response.

I am not creating new log in page for my website. I am trying to overlay AEM author instance default login page. I have copied /libs/granite/core/content/login/ pages to /apps/granite/core/content/login/ in crx de. As described in  AEM 6.1 - Login Background Image

This issue is observed when user provides username/ password and clicks on submit button.

Avatar

Level 1

Thanks for your response.

I am trying to overlay AEM author instance default login page not for publish instance.

Avatar

Level 10

Are you trying to modify /libs/granite/core/components/login/login.jsp?

Avatar

Level 1

Yes. I am overlaying /libs/granite/core/components/login/login.jsp to /apps folder so that I can change background image.