Message Boards

Users with no-emailaddress.com have to enter new Email just after login ?

majdi Achouri, modified 3 Years ago.

Users with no-emailaddress.com have to enter new Email just after login ?

Junior Member Posts: 38 Join Date: 11/21/19 Recent Posts
Hello Community

I have users in the database with initial email addresses that contains the suffix " @no-emailaddress.com " they are generated by Liferay, The problem is when I try to login to the portal with one of those users, when I enter the screenName+ password correctly I will be redirected to a another screen that asks me to re-enter a valid email, 

I did changed the email address suffix from   @no-emailaddress.com to @company.com after that I could log to my portal correctly without any problem( with the correct landing page), if I return it back to   @no-emailaddress.com  and try again then the intermediate email verification screen also return back,

Is there a solution to directly log into my portal without passing with this verification interface of corse with the default suffix  ?

I was not able to understand why this happen with the default suffix and I was not able to Login..
Maybe there is a property to set up ? Or maybe I find someone who can help by recommending something !

Regards
Majdi
thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Users with no-emailaddress.com have to enter new Email just after login

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
Hi,
Have u tried setting below property to false.
company.security.strangers.verify=false
majdi Achouri, modified 3 Years ago.

RE: Users with no-emailaddress.com have to enter new Email just after login

Junior Member Posts: 38 Join Date: 11/21/19 Recent Posts
Hi Mohamed,
Thx for your reply!

I added the line you mention in the  portal-ext.properties under the Liferary 7.3.0 home folder, But we still have the same problem.
I think there is a code condition on the emailAddress if it contains the @no-emailaddress.com the portal will redirect me to this verification page ( see attached image).
You can remark that the url contains at the end /c and this is not correct.
Also if I choose a new email @ nothing is happen when clicking on " Enregistrer" , The console looks fine and displays all the logs like in the normal case, and also the Landing-page class responsible for the postLogin is also invoked well.

My aim now is to find the condition that prevent the users with this suffix to enter to the portal by looking for the AuthenticatedSessionManager's login method code source because I'm using the

_authenticatedSessionManager.login( httpServletRequest, httpServletResponse, login, password, rememberMe, authType);    to authenticate the user with those params

I injected it like that in customLoginMVCActionCommand class

@Reference
        private AuthenticatedSessionManager _authenticatedSessionManager;

for now I'm checking this  AuthenticatedSessionManagerImpl bexcause it contains the source code of the login method

https://github.com/liferay/liferay-portal/blob/master/portal impl/src/com/liferay/portal/security/auth/session/AuthenticatedSessionManagerImpl.java#L253
Am I in the right path ? Otherwise, any new ideas are appreciated.
Thanks
thumbnail
Mohammed Yasin, modified 3 Years ago.

RE: Users with no-emailaddress.com have to enter new Email just after login

Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
There is flag at user level also which can be disabled for  email address verification , You can write Service Wrapper for UserlocalService  . 
Update the addUserwithWorkflow (..) with UserlocalService .updateEmailAddressVerified(long userId, boolean emailAddressVerified)
majdi Achouri, modified 3 Years ago.

RE: Users with no-emailaddress.com have to enter new Email just after login

Junior Member Posts: 38 Join Date: 11/21/19 Recent Posts
Hello Mohamed,
Thank you for your recommendation and your help, I found another solution by setting a property in portal-ext.properties , I will Share it here maybe it could help someone else, 

Solution:  Liferay generate automatically email address for users that does not have  email address So here Liferay will generate email address like userId@Suffix which suffix here is already set up in the users.email.address.auto.suffix=Suffix

So In my case I tried to sign in to the portal with a user that does not has an email address so that's why Liferay pushed me to enter an email address before logging in because it the emailAddress is required,

So to resolve this I added this property to the portal-ext.properties : users.email.address.required=false   and the problem get resolved and could access to my Portal now. 
The final solution is to add those line in the portal-ext.properties: 

users.email.address.required=false
users.email.address.auto.suffix=@no-emailaddress.com
users.email.address.generator=com.liferay.portal.security.auth.DefaultEmailAddressGenerator


Regards,
​​​​​​​Majdi