solid-contrib / solid-inbox

Personal Inbox application
https://solid.github.io/solid-inbox/
MIT License
30 stars 10 forks source link

No response/error after trying to log in with WebId #3

Open michaelj23 opened 7 years ago

michaelj23 commented 7 years ago

After clicking "Yes, I have a WebId" on the home page, page remains blank. Console shows error: undefined:1 Uncaught (in promise) Don't know how to parse text/html; charset=utf-8 yet

ghost commented 7 years ago

fwiw the error is happening here: https://github.com/solid/solid-inbox/blob/6394d5387388ee84735335fb7cbd55e1d8eac23c/js/solid.js#L151-L169

In login -> gotWebId the following is being called:

The head request using Solid.auth.login() is returning an empty webid/user.

"{"linkHeaders":{},"method":"head","allowedMethods":{},"graph":null,"types":[],"url":"https://solid.github.io/solid-inbox/","user":"","websocket":"","xhr":{}}"

With some debugging of the xhr requests i see the following:

console.log(defaultAuthEndpoint, url, alternateAuthUrl)
VM739:1 https://databox.me/ https://solid.github.io/solid-inbox/ https://databox.me/

undefined
solid.js:2275 XHR finished loading: HEAD "https://solid.github.io/solid-inbox/".
SolidWebClient.solidRequest @ solid.js:2275
solidRequest @ solid.js:2252
head @ solid.js:2290
login @ solid.js:156
login @ app.js:737
onclick @ VM715 :32

console.log(JSON.stringify(solidResponse))
VM774:1 {"linkHeaders":{},"method":"head","allowedMethods":{},"graph":null,"types":[],"url":"https://solid.github.io/solid-inbox/","user":"","websocket":"","xhr":{}}

I then tried various methods to curl with -I, --key, --cacert, and --cert to databox.me, but was having issues with the keychain. Tried various methods and formats to include the keychain. Safari, and chrome both pick up what I believed to be the proper cert.

with mixed results that look like this:

curl --key jmunsch.pem:$password -v -I https://databox.me/                                                                                                                                     [23:23:59]
*   Trying 162.243.217.227...
* Connected to databox.me (162.243.217.227) port 443 (#0)
* WARNING: SSL: CURLOPT_SSLKEY is ignored by Secure Transport. The private key must be in the Keychain.
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.databox.me
* Server certificate: Gandi Standard SSL CA 2
* Server certificate: USERTrust RSA Certification Authority
* Server certificate: AddTrust External CA Root
> HEAD / HTTP/1.1
> Host: databox.me
> User-Agent: curl/7.43.0
> Accept: */*
> 
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
< Accept-Patch: application/json, application/sparql-update
Accept-Patch: application/json, application/sparql-update
< Accept-Post: text/turtle, application/json
Accept-Post: text/turtle, application/json
< Access-Control-Allow-Credentials: true
Access-Control-Allow-Credentials: true
< Access-Control-Allow-Origin: *
Access-Control-Allow-Origin: *
< Access-Control-Expose-Headers: User, Location, Link, Vary, Last-Modified, WWW-Authenticate, Content-Length, Accept-Patch, Accept-Post, Allow, Updates-Via, Ms-Author-Via
Access-Control-Expose-Headers: User, Location, Link, Vary, Last-Modified, WWW-Authenticate, Content-Length, Accept-Patch, Accept-Post, Allow, Updates-Via, Ms-Author-Via
< Access-Control-Max-Age: 1728000
Access-Control-Max-Age: 1728000
< Allow: OPTIONS, HEAD, GET, PATCH, POST, PUT, MKCOL, DELETE, COPY, MOVE, LOCK, UNLOCK
Allow: OPTIONS, HEAD, GET, PATCH, POST, PUT, MKCOL, DELETE, COPY, MOVE, LOCK, UNLOCK
< Content-Length: 4096
Content-Length: 4096
< Content-Type: text/turtle
Content-Type: text/turtle
< Etag: "a3b08ae4b3718966cc83269e8998f592"
Etag: "a3b08ae4b3718966cc83269e8998f592"
< Link: <https://databox.me/,acl>; rel="acl", <https://databox.me/,meta>; rel="meta"
Link: <https://databox.me/,acl>; rel="acl", <https://databox.me/,meta>; rel="meta"
< Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type"
< Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
< Link: <https://databox.me/,meta>; rel="meta"
Link: <https://databox.me/,meta>; rel="meta"
< Ms-Author-Via: DAV, SPARQL
Ms-Author-Via: DAV, SPARQL
< Updates-Via: wss://databox.me/
Updates-Via: wss://databox.me/
< User: 
User: 
< Vary: Origin
Vary: Origin
< Date: Wed, 12 Apr 2017 06:24:30 GMT
Date: Wed, 12 Apr 2017 06:24:30 GMT

I added it via: security import jmunsch.pem -k ~/login.keychain using macosx 10.11.6

I created it via: openssl req -x509 -newkey rsa:4096 -keyout jmunsch.pem -out jmunsch.pem -days 900 version OpenSSL 0.9.8zh 14 Jan 2016

I am currently guessing there is an issue with how I created the certificate and added it to the keychain, but i'm not sure either.

ghost commented 7 years ago
Domain Name: DATABOX.ME
Registry Domain ID: D108500000001703255-AGRS
Registrar WHOIS Server:
Registrar URL: http://www.godaddy.com
Updated Date: 2016-09-18T14:15:09Z
Creation Date: 2010-11-29T01:21:00Z
Registry Expiry Date: 2017-11-29T01:21:00Z
Registrar: GoDaddy.com, LLC
Registrar IANA ID: 146
Registrar Abuse Contact Email:
Registrar Abuse Contact Phone:
Domain Status: clientDeleteProhibited https://icann.org/epp#clientDeleteProhibited
Domain Status: clientRenewProhibited https://icann.org/epp#clientRenewProhibited
Domain Status: clientTransferProhibited https://icann.org/epp#clientTransferProhibited
Domain Status: clientUpdateProhibited https://icann.org/epp#clientUpdateProhibited
Registry Registrant ID: CR68004977
Registrant Name: Sandro Hawke
Registrant Organization: Sandro Hawke
Registrant Street: 23 Lord St
Registrant City: Waltham
Registrant State/Province: Massachusetts
Registrant Postal Code: 02451
Registrant Country: US
Registrant Phone: +1.6175003668
Registrant Phone Ext:
Registrant Fax:
Registrant Fax Ext:
Registrant Email: sandro@w3.org
Registry Admin ID: CR68004979
Admin Name: Sandro Hawke
Admin Organization: Sandro Hawke
Admin Street: 23 Lord St
Admin City: Waltham
Admin State/Province: Massachusetts
Admin Postal Code: 02451
Admin Country: US
Admin Phone: +1.6175003668
Admin Phone Ext:
Admin Fax:
Admin Fax Ext:
Admin Email: sandro@w3.org
Registry Tech ID: CR68004978
Tech Name: Sandro Hawke
Tech Organization: Sandro Hawke
Tech Street: 23 Lord St
Tech City: Waltham
Tech State/Province: Massachusetts
Tech Postal Code: 02451
Tech Country: US
Tech Phone: +1.6175003668
Tech Phone Ext:
Tech Fax:
Tech Fax Ext:
Tech Email: sandro@w3.org
Name Server: NS57.DOMAINCONTROL.COM
Name Server: NS58.DOMAINCONTROL.COM

@sandhawke is there anyone we can talk to about databox.me, for guidance / user support?

ghost commented 7 years ago

Possibly related: https://github.com/solid/solid/issues/118

CaptSolo commented 7 years ago

I am also getting the same exception (using a self-hosted WebID).

The exception is thrown by rdf.parse() function in rdflib.min.js (line 4, column 28868).

It is called from solid.js function parseGraph() @ line 1783. Among its parameters are:

parseGraph() is called from solid.js @ line 281:

var parsedProfile = graphUtil.parseGraph(profileUrl, response.raw(), contentType)

... and the reason it sends its own HTML body is because the profileURL parameter is empty ("").

How is this function supposed to determine the profileURL? The page never asked for it.

deiu commented 7 years ago

It looks like the request to databox.me doesn't return an User header, which means that the user was not authenticated. My immediate suggestion is to wait until the Solid teams rolls out the new OIDC-based auth, which is supposed to happen soon.

melvincarvalho commented 6 years ago

I get this error too

Uncaught (in promise) Don't know how to parse text/turtle;charset=UTF-8 yet

I think the issue here is the charset parameter

IIRC older versions of rdflib.js had a bug where it didnt understand charset

The latest version I think fixes this

Suggest upgrading rdflib to the newest version, which is probably a good idea anyway