solid-contrib / profile-viewer-tutorial

https://solid.inrupt.com/docs/app-on-your-lunch-break
48 stars 36 forks source link

Update solid-auth-client and popup to latest version #4

Open steven-borruso opened 6 years ago

steven-borruso commented 6 years ago

Greetings, Not sure if this is the right place to ask for help but ....

I'm trying to implement the "build a solid app during lunchtime" tutorial from here - https://solid.inrupt.com/docs/app-on-your-lunch-break

I've reviewed and installed all of the files from the tutorial on my remote hosted Linux server.

When I hit the test app in a Chrome browser I can click the Login button, which launches the popup.html UI listing 4 potential IDPs to choose from (one being a choice to login to my website but ignored that choice... see attached debug doc )

When I click the IDP choice for - "Log in with Solid Community" nothing happens in the browser (same result when clicking all of IDP choices)

Tracing in the browser when clicking an IDP choice shows the calls to - https://solid.community/.well-known/openid-configuration -and- https://solid.community/jwks both return an HTTP 200 with response data.

The browser Console shows the following 2 errors (please see also attached debug doc)- Error: expected postMessage call for 'storage/getItem' to return a string, but got value null TypeError: Cannot read property 'importKey' of undefined

Chrome Browser version - Version 68.0.3440.106 (Official Build) (64-bit)

Not sure how to debug this further. Any assistance/advice is most appreciated. Thanks !

debug_auth_request.docx

steven-borruso commented 6 years ago

This is probably my fault since just realized I didn't implement all of the steps from the tutorial ... duh ... assumed I could login with what I had implemented so far .... will continue with implementing all of the tutorial steps and report back.

RubenVerborgh commented 6 years ago

Good luck, feel free to reopen if it doesn't work!

steven-borruso commented 6 years ago

Thanks Ruben ... I refreshed all files from solid/profile-viewer-tutorial in git onto my server but still run into the same browser console errors when I click an IDP in the popup.html. Probably something silly I'm doing wrong but not sure how to proceed at this point.

Again any assistance is appreciated ... no hurry ... just playing at this point ... I updated the debug info to include responses to the 2 calls prior to seeing the errors in the browser console ....

debug_auth_login.docx

RubenVerborgh commented 6 years ago

Thanks, will look into this. New error message for me.

james-martin-jd commented 6 years ago

For what it's worth, the angular generator sample app is having the same issue. I suspect it's something to do with a cloud-server-deployed application in general, interacting with solid-auth-client. Another user with the same issue tried opening up some more ports, just in case, but that didn't help.

steven-borruso commented 6 years ago

For what it's worth, I mapped the browser console errors to code snippets in solid-auth-client-bundle.js where the errors occur - debug_auth_login_error_mapping.docx Will try running with a formatted version of solid-auth-client-bundle.js source to see if I can trace things easier and narrow down a bit further

nealmcb commented 6 years ago

I see identical behavior for this bug, using the master branch, Chrome Version 70.0.3538.35 (Official Build) beta (64-bit) and a python3 -m http.server local web server.

steven-borruso commented 6 years ago

Expanded the auth client javascript code in popup.html (similar if not the same code as in solid-client-bundle.js) where the errors actually occur and tried to trace when errors happen ... don't understand flow/code well enough other than most variable values are null or undefined where the errors tests trip.

RubenVerborgh commented 6 years ago

So the Error: expected postMessage call for 'storage/getItem' to return a string bug has TypeError: been addressed in https://github.com/solid/solid-auth-client/issues/73, but this still leaves the mysterious Cannot read property 'importKey' of undefined, which might or might not be addressed (but I cannot reproduce).

ariamoraine commented 6 years ago

I'm also getting the same issues with the solid app on your lunch break. I'm using windows chrome and the suggested local-web-server. While trying to log in the popup.html is getting the same two errors that steven-borruso mentioned "expected postMessage call for 'storage/getItem' to return a string, but got value null" and "Cannot read property 'importKey' of undefined". I also thought I was maybe doing something wrong with my app so I tried cloning the finished GitHub project that is linked at the end of the tutorial. It's also coming back with the same errors. I'm just messing around so no rush but any help would be appreciated.

RubenVerborgh commented 6 years ago

@ariamoraine Do you still get it if you replace the following files:

ariamoraine commented 6 years ago

It's working! So I pulled out the const popupUri = 'popup.html'; line that is in the github repo and replaced it with the const popupUri = 'https://solid.github.io/solid-auth-client/dist/popup.html'; That seemed to do the trick. Thank you!

RubenVerborgh commented 6 years ago

Perfect, then I will update the popup in the source.

steven-borruso commented 6 years ago

Still seeing "importKey" property issue ...

I replaced my versions of solid-auth-client.bundle.js and popup.html with versions found at these locations (sited above) -

https://solid.github.io/solid-auth-client/dist/solid-auth-client.bundle.js https://solid.github.io/solid-auth-client/dist/popup.html

No longer see the original error of - Error: expected postMessage call for 'storage/getItem' to return a string, but got value null

But still seeing the following error in the browser console when clicking the"Login with Solid Community" IDP button on the popup html page -
TypeError: Cannot read property 'importKey' of undefined

image

RubenVerborgh commented 6 years ago

@steven-borruso Created https://github.com/solid/solid-auth-client/issues/79. Problem is I can't reproduce yet. If you could figure out what config exactly causes this, I can help.

steven-borruso commented 6 years ago

Found the "problem" ... my bad ... wasn't hitting my sample app site url with https ... was using http ... seems to be working ... can login now ... thx !

RubenVerborgh commented 6 years ago

@steven-borruso Great, then we need a way to detect this and warn the user.

soumyakantiroychowdhury commented 5 years ago

I followed the steps here:

https://solid.inrupt.com/docs/writing-solid-apps-with-angular

And getting the same issue.

image

Edit:

I got this issue in Chrome, Version 71.0.3578.98 (Official Build) (64-bit) on Windows 10. I tried Firefox version 60.4.0esr (64-bit) and I am able to log in using Solid Community account.

lukatavcer commented 5 years ago

I followed the steps here:

https://solid.inrupt.com/docs/writing-solid-apps-with-angular

And getting the same issue.

image

Edit:

I got this issue in Chrome, Version 71.0.3578.98 (Official Build) (64-bit) on Windows 10. I tried Firefox version 60.4.0esr (64-bit) and I am able to log in using Solid Community account.

I was having the same problem while trying to login via HTTP, moving to HTTPS fixed it. Still don't know what caused it.