Repository navigation
Description
Description
As the title says. This is not unexpected, should have seen this coming actually.
There are 2 issues with the current implementations. Both could be fixed in CSS itself.
1. The test harness can't find the HTML POST form
Relevant failed run: https://github.com/solid/community-server/runs/5180518302?check_suite_focus=true#step:9:164
During the login procedure the CTH does a GET to /idp/login/ and tries to find the form. The issue here is that the CTH does not send an Accept header requesting HTML and since the latest changes, we return JSON instead of HTML if there are no preferences. Easiest solution here is to add a line changing the preferences to HTML in case there is no accept header.
Note that it actually is not really necessary for the CTH to find the form, it can just post to the same URL and the JSON we return when doing the GET there is
{
"required": {
"email": "string",
"password": "string",
"remember": "boolean"
},
"controls": {
"register": "http://localhost:3000/idp/register/",
"index": "http://localhost:3000/idp/",
"prompt": "http://localhost:3000/idp/prompt/",
"login": "http://localhost:3000/idp/login/",
"forgotPassword": "http://localhost:3000/idp/forgotpassword/"
},
"apiVersion": "0.3"
}But perhaps it is easier for the CTH to check for a form to have a consistent solution for all servers. Although it would be nice to send a Accept: text/html header along in that case.
2. We no longer send the location headers the CTH expects
Relevant failed run: https://github.com/solid/community-server/runs/5180809325?check_suite_focus=true#step:9:267
This is completely caused by the server. The IDP API was changed to no longer do redirects but instead return JSON objects containing a location field to make it easier to handle the server output on a dynamic HTML page. But of course this breaks systems that did the call directly and did not depend on the HTML behaviour. The easy fix here is to simply also send a location here together with the JSON object. Fortunately CTH does not check the status code, only if the header is there so this actually solves the problem.
This is not completely correct from an HTTP point of view though, so we probably want a more decent solution (although the previous could be used in the meantime). I was thinking of either doing the redirect as usual again, unless a client sends along a specific HTTP header indicating they do not want to do redirects (a different accept header? application/no-redirect+json? 😄), or set up a server specifically that does normal redirect behaviour by removing the class that does this change from the config. Personally I prefer the first solution so we don't need a specific config for the CTH.
Activity
RubenVerborgh commentedon Feb 15, 2022
I do like that direction; and we should still set up a meeting where you walk me through the need of the non-redirect version.
jvherweg commentedon Feb 16, 2022
Tested also with the changes from #1166 and PKCE had to be disabled. After that everything works though. This does seem an issue as the Solid OIDC spec states:
So this seems to be an issue with the CTH. Can disable this on the server in the meantime though.
Relevant failed run: https://github.com/solid/community-server/runs/5216797899?check_suite_focus=true#step:9:159
/cc @edwardsph
edwardsph commentedon Feb 18, 2022
Thanks for the warning about these issues. They have all been resolved in CTH v1.1.3 via solid-contrib/conformance-test-harness#180. In particular:
Accept: text/htmlheader for compatibility and continues to check for the existence of the form.This still works for CSS v2 and now supports v3 (whether you stick with the redirect or not).
jvherweg commentedon Feb 21, 2022
That's great Pete, thanks! ^^
Going to leave this issue open for now since we might still want to look at what we do with the redirects.
jvherweg commentedon Feb 25, 2022
We have decided to keep this behaviour for now (with some extra explanation in the code eceb710 )