This is a question related to [Solved] How to attest possession of a WebID (from arbitrary source)?, but with different focus.
In short: in JS, to fetch a Solid resource, how can I share the authenticated headers with a remote server, and let the remote server perform the request?
The usages are:
- The remote server can verify my identity (similar to the referenced post);
- The remote server can verify that I have permission to access the target resource.
What I understand so far
Based on my understanding, it looks like the following flow should work:
- The client obtains the authentication header to the target resource;
- The client sends a request to the relevant endpoint at the remote server, with payload/data containing the authentication header (and the link to the target resource if the remote server doesn’t know this beforehand);
- The remote server extracts the authentication header from payload/data, and attests WebID as stated in the linked post (through access-token-verifier);
- The remote server puts the header into HTTP request, and performs the request to the target resource.
If it indeed works based on the specification, how can I do Step 1 using any JS library (esp. @inrupt/solid-client-authn-browser
)?
I know I can get a fetch object performing authenticated fetches, but there does not seem to be a function to obtain the relevant request header only?