Skip to content

Error message fails to render on /idp/ #1033

Closed

Description

@RubenVerborgh

When starting the default server and visting http://localhost:3000/idp/, the browser shows:

InvalidRequest: invalid_request

with the logs reading

2021-10-29T14:29:40.826Z [ChainedConverter] warn: No conversion path could be made from internal/error to text/plain,internal/*.

In contrast, curl -i https://drive.verborgh.org/idp/ gives

HTTP/2 404
date: Fri, 29 Oct 2021 14:30:54 GMT
content-type: application/json; charset=utf-8
content-length: 114
vary: Accept-Encoding
vary: Accept,Authorization,Origin
x-powered-by: Community Solid Server
updates-via: wss://drive.verborgh.org/
access-control-allow-origin: *
access-control-allow-credentials: true
access-control-expose-headers: Accept-Patch,ETag,Last-Modified,Link,Location,MS-Author-Via,Updates-Via,WAC-Allow
strict-transport-security: max-age=63072000

{"error":"invalid_request","error_description":"unrecognized route or not allowed method (GET on /idp/register/)"}

We might want to check if #1030 mitigates this.

Activity

  1. added
    🐛 bug
    on Oct 29, 2021
  2. jvherweg commented on Oct 29, 2021

    @jvherweg
    Member

    I actually get the same result with both localhost and the hosted version. The only difference is if curl or the browser is used. The funny thing is the text error string is (sort of) expected, but I'm not sure why JSON is returned when using curl. Would have to look into it deeper.

    The reason I always expected text is because the IDP component sends all requests for which it doesn't have a handler matching the path to the OIDC component. So at that point that component is responsible for the error handling. We have inserted some of our code in a callback it provides in such cases: https://github.com/solid/community-server/blob/b42150cf52212ff2d6ba76e0db78faf71b10db89/src/identity/configuration/IdentityProviderFactory.ts#L251-L256

    But as you can see it is hardcoded to use text/plain there (which we don't have a converter to but causes the backup error handler to be called). We actually want to parse the accept header there (again) so we can set the correct content type. Probably the reason #764 is still open.

  3. jvherweg commented on Oct 29, 2021

    @jvherweg
    Member

    Also #810

  4. jvherweg commented on Jun 10, 2022

    @jvherweg
    Member

    Has been fixed as part of #1314.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions