Skip to content

Connecting to Solid Pod #57

@audrey314

Description

@audrey314

Describe the bug
Attempting to save/retrieve data to/from the Inrupt SolidPod. It is not fully implemented because we ran out of time this semester and were not able to work out the bugs. The main issue is with authentication / accessing the Solid Pods.

The code / implementation is based primarily on https://docs.inrupt.com/developer-tools/javascript/client-libraries/tutorial/getting-started/.

To Reproduce
Steps to reproduce the behavior:

  1. Switch to the solid_pod_research branch
  2. Run the website with npm start
  3. Login
  4. Navigate to Financial Wellness then Goals
  5. Go to Inspect Element JavaScript Console (right click then inspect, navigate to console)
  6. Fill in the goal description, amount, and date then click submit. Watch for errors in the console.
  7. Refer to the console.log() statements in HealthHarbor/src/Controller/goals.js and compare with the errors / printouts in the console.

Expected behavior
Currently it should be able to access the solid url and profile id and the turtle file should import correctly. The 404 Put request may be because the url is wrong, when using different urls I was getting either 404 or 401 errors.

Screenshots
image
The first 404 error is expected because it tries to access the Solid Dataset that does not yet exist but it should exist after creation.

Desktop (please complete the following information):

  • OS: Windows
  • OS Version: 11
  • Browser: Microsoft Edge
  • Browser Version: 123.0.2420.81

Additional context
Inrupt recently changed certain features like the webId which may mean that the documentation is not not necessarily up to date. I was having with creating a webId and sent a message to Inrupt support.

This was my message
I am a college student and my class is working on building a web app using solid pod. We are using node.js on the backend and react to display the UI. I would really appreciate any help since I am not even entirely sure if what I have been doing is in the right direction.

When a user makes an account their webId is generated but the WebId profile document does not yet exist, so when we try to access the pod we get a 404 error. I have been trying to figure it out based on the “Create a Profile Document” section of WebID Service — Inrupt Enterprise Solid Server but I do not understand how to handle the authentication specified in "Authentication and Authorization Requirements". How can I setup the post request and make sure that it is authenticated? The main goal I have been trying to accomplish is to automatically create the WebId Profile document when the user logs in so that we can then use getPodUrlAll(session.info.webId, { fetch: fetch }); but I am not even sure how to access any of the tokens like client secrets, bearer token, or dpop and I get 401 authentication errors when I try to send requests.

Thanks for the help!

Audrey

I followed the web traffic and was able to find the request that said 201 created and copied the curl bash content. I redacted the tokens and cookies but the rest of it is below. I converted it into into JavaScript fetch using https://curlconverter.com/.

curl 'https://id.inrupt.com/test13'
-X 'POST'
-H 'authority: id.inrupt.com'
-H 'accept: /'
-H 'accept-language: en-US,en;q=0.9'
-H 'authorization: DPoP ONE_OF_THE DPOP_STRINGS_HERE'
-H 'content-length: 0'
-H 'cookie: COOKIES_HERE'
-H 'dpop: ONE_OF_THE_DPOP_STRINGS_HERE'
-H 'origin: https://id.inrupt.com'/
-H 'referer: https://id.inrupt.com/'
-H 'sec-ch-ua: "Chromium";v="122", "Not(A:Brand";v="24", "Microsoft Edge";v="122"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "Windows"'
-H 'sec-fetch-dest: empty'
-H 'sec-fetch-mode: cors'
-H 'sec-fetch-site: same-origin'
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0'

After converting it using curlconverter:

fetch('https://id.inrupt.com/test13', {
method: 'POST',
headers: {
'authority': ''id.inrupt.com'',
'accept': '/',
'accept-language': 'en-US,en;q=0.9',
'authorization': 'DPoP ONE_OF_THE DPOP_STRINGS_HERE',
'content-length': '0',
'cookie': 'COOKIES_HERE',
'dpop': 'ONE_OF_THE_DPOP_STRINGS_HERE',
'origin': 'https://id.inrupt.com',/
'referer': 'https://id.inrupt.com/',
'sec-ch-ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Microsoft Edge";v="122"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Windows"',
'sec-fetch-dest': 'empty',
'sec-fetch-mode': 'cors',
'sec-fetch-site': 'same-origin',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0'
}
});

This was their response

Hello Audrey,
Thank you for contacting Inrupt with your question. I would recommend that you look at the documentation for the Start Service: Start Service — Inrupt Enterprise Solid Server. That application will create a WebID Profile with the correct information for your account, such as the location of your Solid Pod.

Once your WebID Profile has been set up, if you wish to further customize the content of the profile, you can use a special WebID Profile Editor: Inrupt WebID Profile Editor

Because the WebID Profile document is used as a centerpiece of the Solid trust model, there need to be protections on which applications are able to edit this document.

I hope that helps,

Aaron Coburn

NOTE: If you reach out to Inrupt Support make sure to check your ticket every few days to see if they responded because you will likely not get an email or any sort of notification. I put the priority as moderate and got a response within 5 days, but did not realize since there was no notifications whatsoever until they closed my ticket because I hadn't responded.

image image image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions