Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Liferay JSON web service requires user authentication? Ken Driscoll August 31, 2012 2:26 PM
RE: Liferay JSON web service requires user authentication? Harish Kumar September 1, 2012 12:29 AM
RE: Liferay JSON web service requires user authentication? Hitoshi Ozawa September 1, 2012 5:51 AM
RE: Liferay JSON web service requires user authentication? Harish Kumar September 1, 2012 7:33 AM
RE: Liferay JSON web service requires user authentication? Hitoshi Ozawa September 1, 2012 7:38 PM
RE: Liferay JSON web service requires user authentication? Harish Kumar September 2, 2012 1:35 AM
RE: Liferay JSON web service requires user authentication? Ken Driscoll September 4, 2012 6:37 AM
RE: Liferay JSON web service requires user authentication? Ken Driscoll September 4, 2012 12:19 PM
RE: Liferay JSON web service requires user authentication? Harish Kumar September 4, 2012 10:01 PM
RE: Liferay JSON web service requires user authentication? Ken Driscoll September 5, 2012 8:55 AM
RE: Liferay JSON web service requires user authentication? Harish Kumar September 5, 2012 9:13 AM
RE: Liferay JSON web service requires user authentication? Smilelws2010 lwz January 24, 2013 10:16 AM
RE: Liferay JSON web service requires user authentication? Clint Wilde May 7, 2013 5:45 PM
RE: Liferay JSON web service requires user authentication? Smilelws2010 lwz January 24, 2013 10:21 AM
RE: Liferay JSON web service requires user authentication? Shankar Baba September 3, 2013 1:52 AM
RE: Liferay JSON web service requires user authentication? Tomas Polesovsky September 3, 2013 5:28 AM
Ken Driscoll
Liferay JSON web service requires user authentication?
August 31, 2012 2:26 PM
Answer

Ken Driscoll

Rank: Junior Member

Posts: 57

Join Date: July 2, 2012

Recent Posts

I have a json web service going on my liferay. However, the first time I access it, it prompts me for a username and password. This is a problem for me, so is there any way to call the service without needing to enter that info? When invoking the url, I will only have a authentication token available, so is it possible to pass this as an argument instead?

Thanks in advance.
Harish Kumar
RE: Liferay JSON web service requires user authentication?
September 1, 2012 12:29 AM
Answer

Harish Kumar

Rank: Expert

Posts: 348

Join Date: July 31, 2010

Recent Posts

If you have defined your method with public access then you can access them without user authentication. make sure you are using url format like below

http://:/[portlet-context]/api/jsonws


Regards,
Hitoshi Ozawa
RE: Liferay JSON web service requires user authentication?
September 1, 2012 5:51 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

If you have defined your method with public access then you can access them without user authentication. make sure you are using url format like below

http://:/[portlet-context]/api/jsonws


Are you suggesting to send username/password in the message and do authentication within the serverside's json service?

Try Ray's suggestion in the following thread:
http://www.liferay.com/community/forums/-/message_boards/message/938984
Harish Kumar
RE: Liferay JSON web service requires user authentication?
September 1, 2012 7:33 AM
Answer

Harish Kumar

Rank: Expert

Posts: 348

Join Date: July 31, 2010

Recent Posts

Hi Hitoshi,

As Ken asked, how can he access custom web service method without user authentication,

1 it prompts me for a username and password. This is a problem for me, so is there any way to call the service without needing to enter that info?


So I suggested him that method with public access can be accessed without user authentication by using that url format ( ie without secure in it). One thing I forgot to mention ie Liferay version.

Regards,
Harish
Hitoshi Ozawa
RE: Liferay JSON web service requires user authentication?
September 1, 2012 7:38 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

When invoking the url, I will only have a authentication token available, so is it possible to pass this as an argument instead?


I think Ken want to still have authentication but want to pass user/password. It's a security risk to have unauthenticated JSON service.
Harish Kumar
RE: Liferay JSON web service requires user authentication?
September 2, 2012 1:35 AM
Answer

Harish Kumar

Rank: Expert

Posts: 348

Join Date: July 31, 2010

Recent Posts

1 It's a security risk to have unauthenticated JSON service.


Agree with you, specially if methods are not read only.
Ken Driscoll
RE: Liferay JSON web service requires user authentication?
September 4, 2012 6:37 AM
Answer

Ken Driscoll

Rank: Junior Member

Posts: 57

Join Date: July 2, 2012

Recent Posts

No no, I will not have a username or password available to me when I call this service, only a valid authentication token. Can I use this instead somehow?
Ken Driscoll
RE: Liferay JSON web service requires user authentication?
September 4, 2012 12:19 PM
Answer

Ken Driscoll

Rank: Junior Member

Posts: 57

Join Date: July 2, 2012

Recent Posts

Followup: . I’ve tried removing the /secure/ section of the url and added a valid authentication token parameter, but it always returns: “{"exception":"Invalid authentication token"}“. Any ideas?
Harish Kumar
RE: Liferay JSON web service requires user authentication?
September 4, 2012 10:01 PM
Answer

Harish Kumar

Rank: Expert

Posts: 348

Join Date: July 31, 2010

Recent Posts

Which liferay version you are using?
Ken Driscoll
RE: Liferay JSON web service requires user authentication?
September 5, 2012 8:55 AM
Answer

Ken Driscoll

Rank: Junior Member

Posts: 57

Join Date: July 2, 2012

Recent Posts

6.1.1 GA2
Harish Kumar
RE: Liferay JSON web service requires user authentication?
September 5, 2012 9:13 AM
Answer

Harish Kumar

Rank: Expert

Posts: 348

Join Date: July 31, 2010

Recent Posts

Hi Ken

Same issue is already being discussed here http://www.liferay.com/community/forums/-/message_boards/view_message/15682601

but I didn't find any registered issue for this.

Reagrds,
Smilelws2010 lwz
RE: Liferay JSON web service requires user authentication?
January 24, 2013 10:16 AM
Answer

Smilelws2010 lwz

Rank: Regular Member

Posts: 157

Join Date: December 16, 2010

Recent Posts

HI Harish,

I have a sample service builder portlet with remote-service set to true

Now I want to access it through a URL. On hitting the url, http://localhost:8080/sample-portlet/api/jsonws/?serviceClassName=com.sample.service.SampleServiceUtil&serviceMethodName=findemail&serviceParameters=&email=abc@abc.com .

It is prompting for user name, password. Is there a way to avoid that? I saw the property to be added in portlat-ext - json.service.auth.token.enabled=false, but did not do much help.

Any thoughts or reference. Our use case is that whenever a change happens on a particular web content on a public site (no login is needed on that site), it should make a url call to the liferay service builder.

Thanks in advance

Smile
Smilelws2010 lwz
RE: Liferay JSON web service requires user authentication?
January 24, 2013 10:21 AM
Answer

Smilelws2010 lwz

Rank: Regular Member

Posts: 157

Join Date: December 16, 2010

Recent Posts

HI Harish,

By 'method with public access" does not require user authentication, do you mean just make the methods and class public?
Clint Wilde
RE: Liferay JSON web service requires user authentication?
May 7, 2013 5:45 PM
Answer

Clint Wilde

Rank: New Member

Posts: 6

Join Date: March 5, 2013

Recent Posts

I know this is an old post, but maybe this will help others. Liferay JSON and SOAP methods use Basic HTTP authentication, so you need to include login credentials in the URL. Assuming your using email as your portal authentication token, your URL will look like this:

1http://youremail@emailhost.com:password@yourHost.com:8080/api/secure/jsonws/user/get-user-by-email-address/company-id/10154/email-address/test%40liferay.com


Hope this helps...
Shankar Baba
RE: Liferay JSON web service requires user authentication?
September 3, 2013 1:52 AM
Answer

Shankar Baba

Rank: Regular Member

Posts: 144

Join Date: October 17, 2012

Recent Posts

Hi Harish ,
i have tried the way which you have told like http://:/[portlet-context]/api/jsonws, but still iam getting the prompt for username and password.My requirement is , api should work without asking username and password.

Thanks in advance.
Tomas Polesovsky
RE: Liferay JSON web service requires user authentication?
September 3, 2013 5:28 AM
Answer

Tomas Polesovsky

LIFERAY STAFF

Rank: Liferay Master

Posts: 597

Join Date: February 13, 2009

Recent Posts

Hi,

default configuration in web.xml use SecureFilter. When you comment out the SecureFilter declarations, anyone could access your services and data.

If it's OK for you then you can remove the declaration, it's there to be safe by default.