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

Reply via email to