Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Unable to login with AEM username and password in AEMaaCS publish

Avatar

Community Advisor

Hello,

 

A while ago, we conducted a proof of concept (POC) using WKND, successfully logging into the WKND site on publish using a username and password. However, it has abruptly ceased functioning and now returns a 204 No Content error.

 

Only log observed in dispatcher is

 "POST /system/sling/login/j_security_check HTTP/1.1" 204 - "https://publish-p47369-e228224.adobeaemcloud.com/content/wknd/language-masters/en/magazine.html"

 

 Following config us available on the dispatcher

# Allow j_security check for login
/0103 { /type "allow" /method "POST" /url "/system/sling/login/j_security_check" }

What might we be overlooking?


Aanchal Sikka

1 Accepted Solution

Avatar

Correct answer by
Employee

 I got to know from wknd tech team that the request  was hitting the line https://github.com/adobe/aem-guides-wknd/blob/main/dispatcher/src/conf.d/available_vhosts/wknd.vhost...

RewriteRule "^(.*)" - [R=204,L]

I got to know that this will be addressed in the upcoming release.

View solution in original post

9 Replies

Avatar

Community Advisor

Are you storing user credentials in publisher instance?

 

Thanks

Himanshu Jain

Avatar

Community Advisor

@Himanshu_Jain 

The users are created in Author and published.


Aanchal Sikka

Avatar

Employee

@aanchal-sikka did you find a resolution to this issue? I'm also facing the same error with wknd code deployed on AEM as a cloud. One interesting observation is when I trigger the same post request through Postman /system/sling/login/j_security_check, the request does reach AEM publish and I get a 200OK with site content served

Avatar

Administrator

204 No Content response indicates that the server processed the request successfully but has no content to send back. This is often used for actions that modify data without returning a specific payload. In this case, it suggests that the login attempt itself might have gone through, but the expected response (e.g., a redirect or user session information) is missing. Some potential causes and solutions to explore:

Authentication Mechanism:

  • Check Configuration: Verify that the dispatcher configuration for /system/sling/login/j_security_check is correct. Pay attention to parameters like allowedPaths, allowedMethods, and sling:resourceType.
  • Custom Authentication: If custom authentication is involved, ensure it's properly configured and error-free.
  • Access Rights: Double-check that the user account has the necessary access rights to perform the login action.

Dispatcher Caching:

  • Clear Cache: Invalidate the dispatcher cache for the relevant paths or enable debug mode to bypass caching during testing.
  • Caching Rules: Review caching rules that might be interfering with login responses.

WKND Integration:

  • WKND-Specific Issues: Explore potential WKND configuration or logic issues that might be causing the response to be empty.

Content Path:

  • Double-check the content path in the error log (/content/wknd/language-masters/en/magazine.html). Ensure it exists and is configured correctly on the publish instance.

Cross-Origin Resource Sharing (CORS):

  • If the WKND site and AEM instances reside on different domains, CORS must be properly configured on the dispatcher to allow login requests from the WKND origin.
  • Double-check CORS rules in the dispatcher configuration (particularly the /0103 block) and adjust as needed.


Kautuk Sahni

Avatar

Community Advisor

HI @aanchal-sikka 
Do you see any error in the log?

Do you have sticky session if you are using multi-pub setup?

Seems like issue is due to logout/not having valid session.

 



Arun Patidar

Avatar

Community Advisor

There is an issue with aem login specifically in publish as soon as we done with the ui.config build in publish instance. This issue is with Adobe Experience Manager 2023.12.14697.20231215T125030Z-231200 AEM instance

The issue is with com.day.cq.rewriter.linkchecker.impl.LinkCheckerTransformerFactory.cfg.json configuration on line 

"linkcheckertransformer.stripHtmltExtension": true

 

imran__khan_0-1707653697852.png


@aanchal-sikka @kautuk_sahni 

Avatar

Administrator

@aanchal-sikka Were you able to fix this?



Kautuk Sahni

Avatar

Correct answer by
Employee

 I got to know from wknd tech team that the request  was hitting the line https://github.com/adobe/aem-guides-wknd/blob/main/dispatcher/src/conf.d/available_vhosts/wknd.vhost...

RewriteRule "^(.*)" - [R=204,L]

I got to know that this will be addressed in the upcoming release.