Registration of users to be implemented in AEM Website | Community
Skip to main content
Level 3
May 30, 2022
Solved

Registration of users to be implemented in AEM Website

  • May 30, 2022
  • 2 replies
  • 1043 views

I want to implement registration and login in AEM Website.

I found this link: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/sites/authoring/personalization/user-and-group-sync-for-publish-tier.html?lang=en

 

But the proper process for the same is not descibed in it. In it it's mentioned that UserManager API can be used but how is not mentioned.

 

Thank you

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by sunil_kumar_

Hi @janhavi_singh ,

Are you looking to create user in AEM only or in some third party. If you are looking to create in AEM, you can create user using UserManager Api and for Login, you can write a simple component. 
You can use this code to login. 

                            <form class="user" method="POST" action="${authenticationUrl}">
                                <input type="hidden" name="resource" value="${redirectResource @ extension = 'html'}">
                                <input type="hidden" name="_charset_" value="UTF-8">
                                <div class="form-group">
                                    <input type="text" id="userEmail" placeholder="User" name="j_username">
                                </div>
                                <div class="form-group">
                                    <input type="password"  id="userPassword" placeholder="Password" name="j_password">
                                </div>
                                <button class="btn btn-primary" type="submit">
                                    Login
                                </button>
                            </form>

authenticationUrl - This in form action can be valid resource but should end with /j_security_check

ie. currentPage.getPath()+"/j_security_check" 
redirectResource -  resource/page to redirect after login

 

To create user, check this. 
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/programmatic-user-creation-in-aem/m-p/191683

2 replies

Himanshu_Jain
Community Advisor
Community Advisor
May 30, 2022

Is the User Data Synchronization feature must be enabled for your program?

 

If not enabled, user information will be persisted for just a short period (1 to 24 hours) before disappearing.

 

Ref: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/sites/authoring/personalization/user-and-group-sync-for-publish-tier.html?lang=en

 

 

Himanshu Jain
sunil_kumar_
sunil_kumar_Accepted solution
Level 5
May 30, 2022

Hi @janhavi_singh ,

Are you looking to create user in AEM only or in some third party. If you are looking to create in AEM, you can create user using UserManager Api and for Login, you can write a simple component. 
You can use this code to login. 

                            <form class="user" method="POST" action="${authenticationUrl}">
                                <input type="hidden" name="resource" value="${redirectResource @ extension = 'html'}">
                                <input type="hidden" name="_charset_" value="UTF-8">
                                <div class="form-group">
                                    <input type="text" id="userEmail" placeholder="User" name="j_username">
                                </div>
                                <div class="form-group">
                                    <input type="password"  id="userPassword" placeholder="Password" name="j_password">
                                </div>
                                <button class="btn btn-primary" type="submit">
                                    Login
                                </button>
                            </form>

authenticationUrl - This in form action can be valid resource but should end with /j_security_check

ie. currentPage.getPath()+"/j_security_check" 
redirectResource -  resource/page to redirect after login

 

To create user, check this. 
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/programmatic-user-creation-in-aem/m-p/191683