Message Boards
Not able to add user using url
Bharath HG, modified 3 Years ago.
Not able to add user using url
New Member Posts: 16 Join Date: 12/17/15 Recent Posts
hi,I am able to enquire a user using the URL of API by appending p_auth value say
http://localhost:8080/api/jsonws/user/get-user-by-id/user-id/146468?p_auth=xm5BTj9v
But when i try to add a user using the URL and appending p_auth
http://test:test@localhost:8080/api/jsonws/user/add-user/company-id/20097/auto-password/false/password1/%3B/password2/%3B/auto-screen-name/true/screen-name/email-address/dfsc%40gmail.com/facebook-id/0/open-id/locale/en_US/first-name/baa/middle-name/last-name/cbb/prefix-id/0/suffix-id/0/male/true/birthday-month/1/birthday-day/1/birthday-year/1970/job-title/group-ids/organization-ids/role-ids/user-group-ids/send-email/true?p_auth=xm5BTj9v
i get error as
Can any one please help?
http://localhost:8080/api/jsonws/user/get-user-by-id/user-id/146468?p_auth=xm5BTj9v
But when i try to add a user using the URL and appending p_auth
http://test:test@localhost:8080/api/jsonws/user/add-user/company-id/20097/auto-password/false/password1/%3B/password2/%3B/auto-screen-name/true/screen-name/email-address/dfsc%40gmail.com/facebook-id/0/open-id/locale/en_US/first-name/baa/middle-name/last-name/cbb/prefix-id/0/suffix-id/0/male/true/birthday-month/1/birthday-day/1/birthday-year/1970/job-title/group-ids/organization-ids/role-ids/user-group-ids/send-email/true?p_auth=xm5BTj9v
i get error as
{"exception":"No JSON web service action with path /user/add-user and method GET for null","throwable":"com.liferay.portal.kernel.jsonwebservice.NoSuchJSONWebServiceException: No JSON web service action with path /user/add-user and method GET for null","error":{"message":"No JSON web service action with path /user/add-user and method GET for null","type":"com.liferay.portal.kernel.jsonwebservice.NoSuchJSONWebServiceException"}}
Can any one please help?
Mohammed Yasin, modified 3 Years ago.
RE: Not able to add user using url
Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
Hi,
We need to add blank values also in urlĀ with null or [] , Please try the below url :
http://test:test@localhost:8080/api/jsonws/user/add-user/company-id/20097/auto-password/false/password1/%3B/password2/%3B/auto-screen-name/true/screen-name/null/email-address/dfsc%40gmail.com/facebook-id/0/open-id/null/locale/en_US/first-name/baa/middle-name/null/last-name/cbb/prefix-id/0/suffix-id/0/male/true/birthday-month/1/birthday-day/1/birthday-year/1970/job-title/null/group-ids/%5B%5D/organization-ids/%5B%5D/role-ids/%5B%5D/user-group-ids/%5B%5D/send-email/true?p_auth=Pguw3Cun
We need to add blank values also in urlĀ with null or [] , Please try the below url :
http://test:test@localhost:8080/api/jsonws/user/add-user/company-id/20097/auto-password/false/password1/%3B/password2/%3B/auto-screen-name/true/screen-name/null/email-address/dfsc%40gmail.com/facebook-id/0/open-id/null/locale/en_US/first-name/baa/middle-name/null/last-name/cbb/prefix-id/0/suffix-id/0/male/true/birthday-month/1/birthday-day/1/birthday-year/1970/job-title/null/group-ids/%5B%5D/organization-ids/%5B%5D/role-ids/%5B%5D/user-group-ids/%5B%5D/send-email/true?p_auth=Pguw3Cun
Bharath HG, modified 3 Years ago.
RE: Not able to add user using url
New Member Posts: 16 Join Date: 12/17/15 Recent Posts
Thanks, it is working. But even when i pass admin parameters in the url like
http://test:test@localhost:8080/api/jsonws/user/add-user/
it gives error as
can any one please help
http://test:test@localhost:8080/api/jsonws/user/add-user/
it gives error as
{"exception":"Access denied to com.liferay.portal.kernel.service.UserService#addUser","throwable":"java.lang.SecurityException: Access denied to com.liferay.portal.kernel.service.UserService#addUser","error":{"message":"Access denied to com.liferay.portal.kernel.service.UserService#addUser","type":"java.lang.SecurityException"}}
can any one please help
Mohammed Yasin, modified 3 Years ago.
RE: Not able to add user using url
Liferay Master Posts: 591 Join Date: 8/8/14 Recent Posts
You either needĀ to be logged in (have active session ) or send user credential through basic auth.