I have checked  on my DSpace 6 : with or without header -H "Accept: 
application/json", the response is the same (200 if the credentials are ok).

curl -v -X POST --data "email=g*&password=g*" -H "Accept: application/json" 
http://localhost:808<https://10.48.110.173:8443/rest/login>0/<https://10.48.110.173:8443/rest/login>rest/login<https://10.48.110.173:8443/rest/login>

Regards,
Cedric
________________________________
De : [email protected] [mailto:[email protected]] De la 
part de Mehrdad Pedram
Envoyé : mardi 28 février 2017 08:01
À : DSpace Technical Support
Cc : [email protected]; [email protected]
Objet : Re: [dspace-tech] Re: dspace5 rest login fails

The problem has been solved, I removed json header and changed the request as 
follow:

$.ajax({
url: '/rest/login ',
type : "POST",
data : '[email protected]&password=mypass',
success: function (response) { alert(response); },
error: function(xhr, status, errorThrown) { alert("Error in /rest/login "+ 
status+ " " + errorThrown); },
complete: function(xhr, status) { alert('complete'); }
});

Its weird, but login request in dspace 6 should not include any additional 
header and data should sent as a plain text.
Hope this help some one...

On Tuesday, February 28, 2017 at 9:39:18 AM UTC+3:30, Mehrdad Pedram wrote:
Thank you, I didn't notice the response cookie  but the problem is persist. i'm 
getting 401 error and there is no response cookies,
As the documentation says below command should return JSESSIONID but it's 
return 401 for me,
curl -v -X POST --data 
"[email protected]<mailto:[email protected]>&password=mypass" 
http://localhost:8080/rest/login
Any advice please?
Yours faithfully.





--
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to 
[email protected]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[email protected]>.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to