Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Registration of users to be implemented in AEM Website

Avatar

Level 3

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/per...

 

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

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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...

View solution in original post

2 Replies

Avatar

Community Advisor

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/per...

 

 

Himanshu Jain

Avatar

Correct answer by
Community Advisor

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...