I am trying to login users via a Servlet apposed to using a form with j_security_check.
After a user fills in a registration form, I'm creating the user and also want to log them in.
The below code does create a login token under the users profile however it doesn't change the current login-token cookie.
Is it possible?
byte[] bytes = "j_username=username&j_password=password".getBytes(StandardCharsets.UTF_8); HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:4503/j_security_check").openConnection(); connection.setDoOutput(true); connection.setRequestMethod("POST"); DataOutputStream writer = new DataOutputStream(connection.getOutputStream()); writer.write(bytes);
Solved! Go to Solution.
Views
Replies
Total Likes
Hi
Please have a look at this Adobe Helpx article for your help:
Link:- https://helpx.adobe.com/experience-manager/using/secure_sites.html
//Building Secure Adobe Experience Manager Web Sites. AEM web site that requires a user to login to view the content of the web site.
Git :- https://github.com/Adobe-Marketing-Cloud/aem-ask-the-experts-login
Reference material :- https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authentication...
~kautuk
Views
Replies
Total Likes
Watch this AEM Ask the Community Experts session on this subject done by Justin:
Building login-based sites in AEM
He covers the proper way to create secure sites for AEM.
Views
Replies
Total Likes
Hi
Please have a look at this Adobe Helpx article for your help:
Link:- https://helpx.adobe.com/experience-manager/using/secure_sites.html
//Building Secure Adobe Experience Manager Web Sites. AEM web site that requires a user to login to view the content of the web site.
Git :- https://github.com/Adobe-Marketing-Cloud/aem-ask-the-experts-login
Reference material :- https://sling.apache.org/documentation/the-sling-engine/authentication/authentication-authentication...
~kautuk
Views
Replies
Total Likes
Hi Terry,
Were you able to achieve this functionality?
Thanks
Tuhin
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies