Foros de discusión

Remote web service with email authentication for front end user

thumbnail
Jonatan Cloutier, modificado hace 9 años.

Remote web service with email authentication for front end user

New Member Mensajes: 24 Fecha de incorporación: 7/06/13 Mensajes recientes
Hello,

We need to use liferay remote service from another server of our own. We use Liferay 6.2 and as specified here: https://www.liferay.com/fr/documentation/liferay-portal/6.2/development/-/ai/service-security-layers-liferay-portal-6-2-dev-guide-05-en we cannot use email as authentication for the remote web service. But we are required to use email authentication for the real user.

My question is then, is it possible to use the web service in any way possible without changing the real user authentication mode?

For the service call, I wouldn't mind to hard code a userId or another token or event doing multiple call if it stay fast enough.

Any solution for this?

Regards,
thumbnail
David H Nebinger, modificado hace 9 años.

RE: Remote web service with email authentication for front end user

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 Mensajes recientes
If I understand correctly you want to log into Liferay using email address, but web service auth should use screen name?

I don't think that's going to be supported, I think whatever method for auth you're using applies across the board.

That said, you can write methods into XxxServiceImpl that are exposed as web services and handle authentication your own way (possibly including some of Liferay's logic but tweaked to handle your requirements).

I just don't think it's going to be supported OOTB.
thumbnail
Jonatan Cloutier, modificado hace 9 años.

RE: Remote web service with email authentication for front end user

New Member Mensajes: 24 Fecha de incorporación: 7/06/13 Mensajes recientes
Well, my favorite way would be to use email for both, but, email isn't supported on the service side while I think it was supported up to 6.1. The result is that I have two requirement:
1. Login real user with their email
2. Use secured remote web service withing another system.

Obviously, the simplest solution is preferable. And I wonder why the default authentication mode lock us out of all the Liferay web service.

Thanks for the suggestion, I'll see if this could be use, but it mean redefining every service call that we need to use remotely...
thumbnail
Michele Zanarotti, modificado hace 9 años.

RE: Remote web service with email authentication for front end user

Junior Member Mensajes: 94 Fecha de incorporación: 20/02/12 Mensajes recientes
Me too had the same problem when reading docs on web services with 6.2 , but I was scared of the statement on the documentation.
Anyway, in my opinion, documentation is either wrong or is not following latest updates.

I'm able to connect to soap web services with email just like previous versions of liferay. Try this.


UserServiceSoapServiceLocator usl=new UserServiceSoapServiceLocator();
usl.setEndpointAddress("Portal_UserService", "https://liferayServerName/api/axis/Portal_UserService?wsdl");
Portal_UserServiceSoapBindingStub puStub=(Portal_UserServiceSoapBindingStub)usl.getPortal_UserService();
puStub.setUsername("myEmail@domain.com"));
puStub.setPassword("myPassword");
UserSoap user = puStub.getUserByScreenName(companyID, "someUserScreenName");   //you can see companyID in the portal settings -> Instances
System.out.println(user);
System.out.println(user.getEmailAddress());


Have a nice day.