Fórumok

JSON call: auth in server with basic auth

Bobo Jager, módosítva 9 év-val korábban

JSON call: auth in server with basic auth

New Member Bejegyzések: 11 Csatlakozás dátuma: 2013.08.01. Legújabb bejegyzések
Hi guys,
I have a problem about JSON REST call (service builder): my portlet runs in apache tomcat server with basic authentication. So, without basic authentication I call my rest url with user test credential in the url path (http://test@liferay.com:test etc.) and it runs!

But with basic authentication it returns {"exception":"Authenticated access required"}, how can I use both authentication to run my rest service?

I use LR 6.2.

Thanks in advance,

Bobo
thumbnail
David H Nebinger, módosítva 9 év-val korábban

RE: JSON call: auth in server with basic auth

Liferay Legend Bejegyzések: 14914 Csatlakozás dátuma: 2006.09.02. Legújabb bejegyzések
basic auth is handled by an additional header that must be defined and set when making json rest call. Basic auth is base 64 of username/password for the basic auth credentials.
Bobo Jager, módosítva 9 év-val korábban

R: JSON call: auth in server with basic auth

New Member Bejegyzések: 11 Csatlakozás dátuma: 2013.08.01. Legújabb bejegyzések
Yes but with apache auth i must use apache credential in rest url. Apache credential are not equal to the LR credential. How I can auth as test (i.e. LR admin) to run my rest method?
I must do a double auth (apache auth, i.e. htaccess file, + liferay auth)...how to do it?
thumbnail
Tomas Polesovsky, módosítva 9 év-val korábban

RE: R: JSON call: auth in server with basic auth

Liferay Master Bejegyzések: 676 Csatlakozás dátuma: 2009.02.13. Legújabb bejegyzések
Hi Bobo,

I don't think this is going to work.

1, there is only one Authorization header in HTTP request
2, you want to send 2 different values in the Authorization header

Although HTTP spec allows multiple values in HTTP header (separated by comma - see Cookie), I haven't seen it used for the Authorization header.