Hi Steve,

Thanks for the reply - the only thing outputted on the logs when the 
request is made is:

2011-03-15 10:14:15,017 INFO  org.dspace.rest.providers.UserProvider @ 
user:anonymous:ip_addr=:entity_exists:29

Thanks,
Mark

On 15/03/11 10:16, Steve Swinsburg wrote:
> A 500 is an internal server error, what do the logs say?
>
> cheers,
> Steve
>
>
> On 15/03/2011, at 9:03 PM, Mark Melia wrote:
>
>> Hi Bojan,
>>
>> I have taken the latest code from the SVN address above and the
>> authentication issue is still there. I am not sure how you are able to
>> over come it without changing the code in the AbstractBaseProvider. I
>> have made the change you suggested - rather than just removing the
>> exception throw. (I can send you a patch file if you would like?)
>>
>> On another note - I am stil trying to get details for a specific
>> community I am doing this by calling the URL -
>>
>> http://localhost:8080/rest/communities/29.xml
>>
>>
>> as outlined below. Can you tell me if I am doing this correct - I am
>> still getting HTTP Status 500. If I have time I will look more deeply
>> into this - if you have no ideas on what is causing it?
>>
>> Thanks,
>> Mark
>>
>>
>> On 14/03/11 16:14, Mark Melia wrote:
>>> Hi Bojan,
>>>
>>> Thanks a million for your reply. I am thinking maybe I do have an
>>> earlier version of the code - Today I tried to get details on one
>>> particular collection using
>>>
>>> http://localhost:8080/rest/communities/29.xml - this resulted in an error -
>>> HTTP Status 500 - Failure processing entity request
>>> (/communities/29.xml): null
>>>
>>> I will have to check the version I am running.
>>>
>>> Thanks again for your help.
>>> Mark
>>>
>>> On 14/03/11 15:51, Bojan Suzic wrote:
>>>> Hi Mark,
>>>>
>>>> I have just checked it and tried to reproduce locally.
>>>> So I tried the following:
>>>>
>>>> http://localhost:8080/rest/search.xml?query=test - got normal results
>>>>
>>>> http://localhost:8080/rest/search.xml?query=test&user=x...@xxx.com - got
>>>> exception 403, we have user but password is not provided
>>>>
>>>> http://localhost:8080/rest/search.xml?query=test&user=x...@xxx.com&pass=correct_password
>>>> - got normal results again as the correct password is provided with
>>>> the user in the query
>>>>
>>>> So, the code you are referring to is executed only if user or pass are
>>>> provided in the query. If they are not provided, it uses anonymous
>>>> user and further should not execute this code.
>>>>
>>>> Maybe you are using some older version from svn? The actual version is
>>>> available at
>>>> http://scm.dspace.org/svn/repo/modules/rest/branches/dspace-rest-gsoc10/.
>>>>
>>>> Also if this problem still persists, could you then try to change this
>>>> code to look like this:
>>>>
>>>> if (!(user.equals("")) {
>>>>    try {
>>>>     ...
>>>>    } catch () ...
>>>>
>>>> }
>>>>
>>>> It could be that underlying code treats blank user differently.
>>>>
>>>> Kind regards
>>>> Bojan
>>>>
>>>>
>>>>
>>>>
>>>>> The action I am calling is the search rest call I am making is search -
>>>>> http://localhost:8080/dspace/search.xml?query=testitem
>>>>> When this is called it looks like the method refreshParams is called in
>>>>> the AbstractBaseProvider class. This method checks if the user is logged
>>>>> in and throws an EntityException if the user is not logged in, which is
>>>>> the case for my search.
>>>>>
>>>>> try {
>>>>> EPerson eUser = EPerson.findByEmail(context, user);
>>>>> if ((eUser.canLogIn())&&    (eUser.checkPassword(pass))) {
>>>>> context.setCurrentUser(eUser);
>>>>> loggedUser = eUser.getName();
>>>>> } else {
>>>>> throw new EntityException("Bad username or password", user, 403);
>>>>> }
>>>>>
>>>>> Any idea would be much appreciated. We are creating a plug-in for Moodle
>>>>> 2.0 so that DSpace can be used as a repository.
>>> ------------------------------------------------------------------------------
>>> Colocation vs. Managed Hosting
>>> A question and answer guide to determining the best fit
>>> for your organization - today and in the future.
>>> http://p.sf.net/sfu/internap-sfd2d
>>> _______________________________________________
>>> DSpace-tech mailing list
>>> DSpace-tech@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>> ------------------------------------------------------------------------------
>> Colocation vs. Managed Hosting
>> A question and answer guide to determining the best fit
>> for your organization - today and in the future.
>> http://p.sf.net/sfu/internap-sfd2d
>> _______________________________________________
>> DSpace-tech mailing list
>> DSpace-tech@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/dspace-tech

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to