Skip to content

Test with Solid bot example #76

Open

Description

@michielbdejong

Activity

  1. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    First one:

    https://test.server.com/.well-known/openid-configuration redirects to https://test.server.com/apps/solid/openid with a 302 and https://www.npmjs.com/package/openid-client doesn't like that. It wants a 200 response directly.

  2. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    According to the openid spec

    Redirects are allowed in the webfinger part of discovering someone's issuer:
    https://openid.net/specs/openid-connect-discovery-1_0.html#IssuerDiscovery

    but we're not allowed to do a redirect in the provider configuration response:
    https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationResponse

  3. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor
  4. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    If I change

    -sed -i '96 i\  RewriteRule ^\\.well-known/openid-configuration /apps/solid/openid [R=302,L]' /var/www/html/.htaccess
    +sed -i '96 i\  RewriteRule ^\\.well-known/openid-configuration /apps/solid/openid [PT]' /var/www/html/.htaccess

    I get a 404 instead of a 302, with a body {"message":"openid-configuration not supported"}
    Now trying with [PT,L]

  5. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    Hm, none of the flag combinations I tried seem to work, even though https://httpd.apache.org/docs/2.4/rewrite/flags.html seems to say it should just work the same way, but with passthrough or proxy instead of redirect.

    Will try with https://github.com/pdsinterop/solid-nextcloud/tree/test-server-24 now.

  6. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    That fixed it! :) Next error:

    request.call https://test.server.com/.well-known/openid-configuration
    (node:17930) UnhandledPromiseRejectionWarning: OPError: expected 201 Created, got: 200 OK
        at processResponse (/Volumes/Michiel Docker/gh/michielbdejong/solid-bot-example/node_modules/openid-client/lib/helpers/process_response.js:41:11)
        at Function.register (/Volumes/Michiel Docker/gh/michielbdejong/solid-bot-example/node_modules/openid-client/lib/client.js:1460:26)
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
        at async ClientRegistrar.getClient (/Volumes/Michiel Docker/gh/michielbdejong/solid-bot-example/node_modules/@inrupt/solid-client-authn-node/dist/login/oidc/ClientRegistrar.js:44:34)
        at async OidcLoginHandler.handle (/Volumes/Michiel Docker/gh/michielbdejong/solid-bot-example/node_modules/@inrupt/solid-client-authn-node/dist/login/oidc/OidcLoginHandler.js:23:28)
        at async ClientAuthentication.login (/Volumes/Michiel Docker/gh/michielbdejong/solid-bot-example/node_modules/@inrupt/solid-client-authn-node/dist/ClientAuthentication.js:13:33)
        at async Session.login (/Volumes/Michiel Docker/gh/michielbdejong/solid-bot-example/node_modules/@inrupt/solid-client-authn-node/dist/Session.js:16:31)
        at async /Volumes/Michiel Docker/gh/michielbdejong/solid-bot-example/app.js:45:3
    
  7. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    Fixed in the test-server-24 branch. Next error:
    When clicking 'Allow' in the NC GUI you don't get redirected back to the app.

  8. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    The web console shows:

    Refused to send form data to 'https://test.server.com/apps/solid/sharing/812ec203ee00103a80d847d7c3d0ace6?returnUrl=/apps/solid/authorize?client_id%3D812ec203ee00103a80d847d7c3d0ace6%26scope%3Dopenid%2520offline_access%2520webid%26response_type%3Dcode%26redirect_uri%3Dhttp%253A%252F%252Flocalhost%253A3000%252Fredirect-from-solid-idp%26code_challenge%3De_fCMrHdT4oqMNY_6CgNY6L7dO4Uy9B8Xhi6v_JWMMI%26state%3DNbgUGvU2v2q3UpPpHriCUpZaC73coXOHjVWIp0BNHNM%26code_challenge_method%3DS256%26prompt%3Dconsent' because it violates the following Content Security Policy directive: "form-action 'self' localhost".
    
  9. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    It does work correctly when I try to log in to https://noeldemartin.github.io/media-kraken/ with my test server.

  10. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    Hm, I put the bot example on http://test.server.com:3000 but that didn't help either. Maybe Nextcloud wants the redirect to be https?

  11. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    @ylebre any idea? (I sent you the test server URL and credentials via Slack)

  12. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    I saw in the database that it does set the client id to the domain with https, so i'll try if i can get my bot example working if i deploy it to Heroku

  13. michielbdejong commented on Jun 17, 2022

    @michielbdejong
    MemberAuthor

    Hm, same error when trying to log in to https://solid-bot-example.herokuapp.com/login :(
    I'll have to leave it here, will check back when I have time next week...

  14. added this to the v0.8.0 milestone on Oct 19, 2022
  15. removed this from the v0.8.0 milestone on Jan 20, 2024
  16. ylebre commented on Jun 28, 2025

    @ylebre
    Member

    Quite late to the party, but I've managed to get this up and running.

    There are a few changes that I've had to do, those are in the branch feature/solid-bot-example to be reviewed:

    • change the result for a successful registration from a 200 OK to 201 created
    • skip adding the id_token to the auth code redirect
    • use the client ID from the auth code data, since it is not sent in the token POST request
  17. ylebre commented on Jun 28, 2025

    @ylebre
    Member

    PR with the changes: #215

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions