cancel
Showing results for 
Search instead for 
Did you mean: 

I'm doing something wrong with cmis basic authenticate using javascript...

michelgraux
Champ in-the-making
Champ in-the-making
Hello,
I'm trying to get an authentication token against an Alfresco 5 "out of the box" server.
I'm using willing to use CMIS Apache Chemistry Parts ( https://chemistry.apache.org/javascript/parts.html ) as my client will be a webpage + javascript.
Using the "index.html" test page found in https://svn.apache.org/repos/asf/chemistry/parts/trunk/cmis-js/test/ and http://laptopacer:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser as a server URL, I get an error.
here below is what I wireshark.
I searched a lot for something obvious, but as a beginner concerning Alfresco and CMIS, nothing is obvious…
NB: I successfully got a token using Java and a POST, but I prefer to make it Javascript.
Do you see what I'm doing wrong?
Thanks in advance,
Michel

OPTIONS /alfresco/api/-default-/public/cmis/versions/1.1/browser HTTP/1.1
Host: laptopacer:8080
Connection: keep-alive
Access-Control-Request-Method: GET
Origin: http://localhost:63342
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36
Access-Control-Request-Headers: accept, access-control-allow-origin, authorization
Accept: */*
Referer: http://localhost:63342/cmis/test/index.html?testNumber=1
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8

HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
WWW-Authenticate: Basic realm="Alfresco -default- tenant"
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Pragma: no-cache
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Sat, 04 Jul 2015 12:24:43 GMT

142e
{
    "status" :
  {
    "code" : 401,
    "name" : "Unauthorized",
    "description" : "The request requires HTTP authentication."
  }, 
 
  "message" : "06040009 Authentication failed for Web Script org\/alfresco\/api\/opencmis\/OpenCMIS.options", 
  "exception" : "org.springframework.extensions.webscripts.WebScriptException - 06040009 Authentication failed for Web Script org\/alfresco\/api\/opencmis\/OpenCMIS.options",
[…]
1 REPLY 1

zoidberg88
Champ in-the-making
Champ in-the-making

Hi,

Im having the same problems. When I look at wireshark I get the error 401 Unauthorized. With a possible malformed packet error.

Does anyone have any suggestions as to what might be the problem? Or corrections on the post above.

Thanks,

Shaun.