Hi,
I guess the short answer to my question is going to be NO, but I would like to continue the discussion of the existing topics: Session restore with solid-client-authn-browser, Losing session when going to different page after login , to see if there’s any progress on this area or someone has a clever workaround in order to be able to reconstruct a Session object in a new page inside the same domain.
I basically get a valid session in my index.html
via login request and I try to “force” restoring it but when I navigate a different page detailview.html
there’s no way I can generate again the same session. I tried by sending the sessionId
as a query param in the URL:
http://localhost:1234/detailview.html?sessionId=18e878b1-0661-434e-94bb-b3c8e1cbe151
to invoke any of the the methods:
await session.clientAuthentication.getSessionInfo(sessionId)
or
await session.clientAuthentication.validateCurrentSession(sessionId)
but the resulting info is not as expected.
In index.html / index.js
I get:
{
"sessionId": "cd43afb5-9381-45a2-bb3a-a61706117fa5",
"webId": "https://fandroide.solidcommunity.net/profile/card#me",
"isLoggedIn": true,
"redirectUrl": "http://localhost:1234/?state=0ec498c2ef964c6abdd8c2636a0d23c0",
"issuer": "https://solidcommunity.net",
"clientAppId": "5138d1ea8ad2cb2871243c179d6b996b",
"clientAppSecret": "d4b0c72d99db894333a162dbda516029",
"tokenType": "DPoP"
}
but in detailview.html / detailview.js
I get:
{
"sessionId": "cd43afb5-9381-45a2-bb3a-a61706117fa5",
"isLoggedIn": false,
"redirectUrl": "http://localhost:1234/?state=0ec498c2ef964c6abdd8c2636a0d23c0",
"issuer": "https://solidcommunity.net",
"clientAppId": "5138d1ea8ad2cb2871243c179d6b996b",
"clientAppSecret": "d4b0c72d99db894333a162dbda516029",
"tokenType": "DPoP"
}
No webId
is defined nor "isLoggedIn"
is true, despite the rest of the values are the same (clientAppId
, clientAppSecret
, etc)
I also know the resulting session object is not valid because if I try to fetch any private resource I’ll get a 401 Unauthorized error.
I thought something like:
const newsession = new Session(session, sessionId)
could do the trick but it’s not.
If someone is interested in giving it a try here’s the repo and steps to reproduce it:
git clone https://github.com/fan-droide/solidclientwebapp.git
cd solidclientwebapp
git checkout test-session-btw-pages
npm i
npm start
Any suggestion would be appreciated, thank you!