solid-client-authn-js icon indicating copy to clipboard operation
solid-client-authn-js copied to clipboard

Can't log in with Safari (On Mac)

Open gibsonf1 opened this issue 5 years ago • 5 comments

image

The following error occurs when trying to log in with Safari browser on a mac durring session.login(): image

To reproduce: Using Safari on a mac, register a free pod on https://trinpod.us , then try to log in. (Please note that trinpod.us will be wiped one more time before the official launch, so any data uploaded will be lost)

Using Chrome on a mac works without issue.

gibsonf1 avatar Feb 06 '21 21:02 gibsonf1

Hi @gibsonf1 ,

I was trying to reproduce this on my mac, Safari v14.0.2 (16610.3.7.1.9), trying to access https://trinpod.us/ but I got a 504 and the page never loaded.

Funny thing is https://trinpod.us/ did loaded successfully on Chrome and I managed to created an account but when tried to log in I got a 404 on the session endpoint and just get redirected to trinpod log in page.

Then I went back and tried logging in using Safari to pod.inrupt.com and solidcommunity.net and it worked fine and without any issues.

Could you please have another look on your end and let us know what you find?

Cheers, Nick

nicolasmondada avatar Feb 08 '21 11:02 nicolasmondada

@nicolasmondada We give a 404 on the /session endpoint as we are not supporting that, so that 404 is on purpose. My cofounder is using trinpod every day with his mac using chrome with no issues. It is possible that you checked it out right as we were doing an update. Do both pod.inrupt.com and solidcommunity.net use the auth library with the /session endpoint functionality?

gibsonf1 avatar Feb 11 '21 16:02 gibsonf1

I just noticed in the server log that we are returning a 204 on the preflight options, and then 404 on the get - I'll try returning 404 on options as well and see if that does the trick

gibsonf1 avatar Feb 11 '21 16:02 gibsonf1

Ok, that then exposed the next issue which is a CORs error when the auth library tries to get the webid resource before authenticating as we do a redirect there because we use short webids and did not send CORs with the redirect. It looks like Safari and Firefox use different headers to request CORs than chrome, so the fix was to look for those other headers, and all is well now.

gibsonf1 avatar Feb 11 '21 19:02 gibsonf1

We seem to have one last problem with Safari, it looks like Safari is unable to process the Options return from TrinPod image Since we fixed a similar issue with FireFox by added allow headers from the server, any help on what the server needs to send for Safari would be greatly appreciated!

gibsonf1 avatar Feb 12 '21 17:02 gibsonf1