Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

obtain-auth-headers helper not working yet #1

Closed
michielbdejong opened this issue Jul 15, 2020 · 10 comments
Closed

obtain-auth-headers helper not working yet #1

michielbdejong opened this issue Jul 15, 2020 · 10 comments

Comments

@michielbdejong
Copy link
Collaborator

I'm pretty much developing this in the master branch for the moment -
Just tried:

NODE_TLS_REJECT_UNAUTHORIZED=0 ts-node-dev test/helpers/obtain-auth-headers.ts

And seeing "invalid json response body at https://localhost:8443/token reason: Unexpected token I in JSON at position 0"
That 'I' is the first character of "Internal Server Error" - it's running into nodeSolidServer/node-solid-server#1445. Investigating.

@michielbdejong
Copy link
Collaborator Author

Now trying with:

+    grant_type: "authorization_code",
+    code_verifier: "codeVerifier" as string,
+    code: "url.query.code" as string,
+    redirect_uri: "redirectUri" as string

@michielbdejong
Copy link
Collaborator Author

@michielbdejong
Copy link
Collaborator Author

If I set:

authorizationCode = {
          exp: 1594816163,
          redirect_uri: 'https://app.com/callback',
          aud: client.client_id,
          sub: 'bla'
        };

on line 546 of src/handlers/TokenRequest.js in @solid/oidc-op then https://github.com/solid/storage-tests/blob/master/test/helpers/obtain-auth-headers.ts#L89 returns something that looks reasonable.

I'll try testing it against https://github.com/michielbdejong/solid-app-kit.

@michielbdejong
Copy link
Collaborator Author

With solid-app-kit I get an error at the registration step already:
solid-contrib/solid-auth-fetcher#2
Should also check why tests from https://github.com/pdsinterop/test-suites are failing for solid-app-kit and see if that's related.

@michielbdejong
Copy link
Collaborator Author

my next thought it, solid-auth-fetcher has all this integrated popup code, i should be able to reverse-engineer that, and in the process, confirm that all of that is working

@michielbdejong
Copy link
Collaborator Author

That was a useful thought, now we have this to work with: solid-contrib/solid-auth-fetcher#11

@michielbdejong
Copy link
Collaborator Author

import { login } from "solid-auth-fetcher";


login({
  oidcIssuer: "https://localhost:8443",
  redirect: "https://mysite.com/redirect"
}).then((session) => {
  console.log("Please visit", (session.neededAction as any).redirectUrl);
})

@michielbdejong
Copy link
Collaborator Author

Should combine this with https://github.com/solid/webid-provider-tests/blob/master/test/surface/token.test.ts#L29 and then that whole flow should be doable from node.

@michielbdejong
Copy link
Collaborator Author

Fixed

michielbdejong added a commit that referenced this issue Oct 28, 2020
Improved on tests for container creation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant