You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to log into a remote site to a non-public document that my WebID https://solid.kjernsmo.net/profile/card#me has been given access to, I end up getting redirected to the remote site's login page.
There has been some debug activity on gitter, but I figured I might as well make an issue on it, and attach a HAR file with a record of a session.
From conversation on Gitter, it sounds like the steps were:
Access a write-protected resource on inrupt.net, get a 401 Unauthorized response, get redirected to Select Provider screen.
Enter an external Web ID (hosted on solid.kjernsmo.net), get redirected to kjernsmo.net/authorize endpoint.
Log in at solid.kjernsmo.net via username & password.
Expected: to be redirected back to the /shared/ protected resource on inrupt.net
Actual: got redirected to inrupt.net/login instead.
From the HAR log above, note that during the initial redirect to kjernsmo.net/authorize, the redirect_uri=https://inrupt.net/api/oidc/rp/https%3A%2F%2Fsolid.kjernsmo.net param is present (inside the request JWT), as expected.
And after login via password, the user is redirected to https://inrupt.net/api/oidc/rp/https%3A%2F%2Fsolid.kjernsmo.net, with the code and state params, as expected. So far so good.
So it sounds like the main issue is that the redirectUrl mechanism, after the callback request, is not working (and resorting to the default /login value).
This was recently fixed in PR #648, so this is either a regression, or maybe inrupt.net running an older solid-server version?
For reference, this is from inrupt.net's server console log, which may be related to this redirect behavior:
Jun 28 08:39:44 ip-10-1-0-245 solid[8478]: Thu, 28 Jun 2018 08:39:44 GMT solid:authentication Logging in via username + password
Jun 28 08:39:44 ip-10-1-0-245 solid[8478]: Thu, 28 Jun 2018 08:39:44 GMT solid:authentication Attempting to login user: kjetil.inrupt.net/profile/card#me
Jun 28 08:40:12 ip-10-1-0-245 solid[8478]: Thu, 28 Jun 2018 08:40:12 GMT solid:authentication Discovering provider for uri: https://solid.kjernsmo.net/profile/card#me
Jun 28 08:40:13 ip-10-1-0-245 solid[8478]: Thu, 28 Jun 2018 08:40:13 GMT solid:authentication Building /authorize url for provider: https://solid.kjernsmo.net
Jun 28 08:40:13 ip-10-1-0-245 solid[8478]: Thu, 28 Jun 2018 08:40:13 GMT solid:authentication Client fetched for issuer https://solid.kjernsmo.net
Jun 28 08:40:13 ip-10-1-0-245 solid[8478]: Thu, 28 Jun 2018 08:40:13 GMT solid:authentication Client fetched for issuer https://solid.kjernsmo.net
Jun 28 08:40:14 ip-10-1-0-245 solid[8478]: Error in AuthCallbackRequest: TypeError: Cannot read property 'payload' of undefined
Jun 28 08:40:14 ip-10-1-0-245 solid[8478]: at AuthCallbackRequest.initSessionUserAuth (/usr/lib/node_modules/solid-server/node_modules/oidc-auth-manager/src/handlers/auth-callback-request.js:120:34)
Jun 28 08:40:14 ip-10-1-0-245 solid[8478]: at Promise.resolve.then.then.then.then.session (/usr/lib/node_modules/solid-server/node_modules/oidc-auth-manager/src/handlers/auth-callback-request.js:90:32)
Jun 28 08:40:14 ip-10-1-0-245 solid[8478]: at process._tickCallback (internal/process/next_tick.js:68:7)
Activity
dmitrizagidulin commentedon Jun 30, 2018
What’s the error, though? Getting redirected to the remote site for login is the expected behavior.
kjetilk commentedon Jul 1, 2018
Huh? But surely, I shouldn't need an account on the remote site to access the documents that my own identity has been authorized to access?
dmitrizagidulin commentedon Jul 2, 2018
From conversation on Gitter, it sounds like the steps were:
inrupt.net, get a 401 Unauthorized response, get redirected to Select Provider screen.solid.kjernsmo.net), get redirected tokjernsmo.net/authorizeendpoint.solid.kjernsmo.netvia username & password.Expected: to be redirected back to the
/shared/protected resource oninrupt.netActual: got redirected to
inrupt.net/logininstead.From the HAR log above, note that during the initial redirect to
kjernsmo.net/authorize, theredirect_uri=https://inrupt.net/api/oidc/rp/https%3A%2F%2Fsolid.kjernsmo.netparam is present (inside therequestJWT), as expected.And after login via password, the user is redirected to
https://inrupt.net/api/oidc/rp/https%3A%2F%2Fsolid.kjernsmo.net, with thecodeandstateparams, as expected. So far so good.So it sounds like the main issue is that the
redirectUrlmechanism, after the callback request, is not working (and resorting to the default/loginvalue).This was recently fixed in PR #648, so this is either a regression, or maybe
inrupt.netrunning an older solid-server version?dmitrizagidulin commentedon Jul 2, 2018
Ok, so it sounds like inrupt.net is running version
4.0.14, which is after pr #648.dmitrizagidulin commentedon Jul 2, 2018
For reference, this is from inrupt.net's server console log, which may be related to this redirect behavior:
dmitrizagidulin commentedon Jul 2, 2018
Ok, found the cause of the
Cannot read property 'payload' of undefinederror above, fix coming shortly (to theoidc-auth-managerlib).Not sure if there's a separate cause for the redirection error, will re-test after the fix.
dmitrizagidulin commentedon Jul 2, 2018
Yep, there it is. in
oidc-auth-manager/src/handlers/auth-callback-request:There's the redirect to
/loginin case of error.dmitrizagidulin commentedon Jul 19, 2018
(This is fixed in
developbranch)