-
Notifications
You must be signed in to change notification settings - Fork 6
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
Consider switching auth client #9
Comments
Thanks, I'll check it out! I'm going to start a new app soon, and I'll try it there first. If that goes well I'll update Media Kraken afterwards. |
@megoth I've done a small app as a proof of concept using the new authentication libraries, can you confirm that it works properly for you? If all's well, I'll move that code into Media Kraken. Here it is: https://ramen.noeldemartin.com I've done my own tests and it should work, but there are a couple of things I'd like to ask you. You mentioned Inrupt's auth client works for old Solid servers as well, but for me it didn't work for node-solid-server v5.2.2. Is there something I am doing wrong? Or you meant to say that it works with the latest version of old servers? Related to that, since I am falling back to |
@NoelDeMartin sorry for late response, have had a vacation for the last three weeks ^_^ I've tested with Inrupt's Solid servers, and the app works with the following: But it fails with pod-compat.inrupt.com: I'm not quite sure what goes wrong here, but I noticed that you haven't given a |
And to answer more of your questions, yes, I did mean the newest versions of the old servers. I don't know to much about the auth algorithms in general, so I'll ping @NSeydoux on this in hopes that he knows more about this. |
Hi @NoelDeMartin, hi @megoth ! Unfortunately, there is no standard way to know if an identity provider and/or a resource server supports DPoP or not a priori. The You are absolutely right @megoth, From what I can see, it looks like Ramen is trying to see if the identity that's provided is either an IdP or a Pod root, to which it appends
I'm not sure that this is causing the issue, but after two failed requests against https://broker.pod-compat.inrupt.com/ (there seems to be some CORS errors, because the IdP is only expecting foreign requests on its defined endpoints, and not on https://broker.pod-compat.inrupt.com/profile/card for instance), another authentication attempt happens, which tries to go through the implicit login flow, which isn't supported by https://broker.pod-compat.inrupt.com/ because it has some security issues. It's not a flow that is implemented by our library, so I guess at this point Ramen switched to So in a nutshell, what's the rule to try the different auth libraries, and is my explanation making any sense ^^ ? |
@megoth @NSeydoux Yes, your explanation makes sense! As you guessed, the problem was that it was using First, I try to obtain the webId. I am doing this to obtain the Then, I try to guess if the server supports DPoP. I do this with some heuristics, because I haven't found a way to know for sure, and seems like there isn't. At the moment, I am reading Finally, depending on the information I got from these two steps, I use a If you want to see the actual code doing this, it's here: src/services/Auth.ts:74 And sadly, it seems like I'm not able to guess that Inrupt's servers support DPoP authentication. The only reason why the others worked was that their domains are hard-coded in my code, and I've fixed You may be wondering why is So, to summarize the current status of this issue. I have been working on the new authentication strategy in the Ramen app, and once I'm confident with that I'll add those improvements to Media Kraken. Right now I have two blockers:
|
TLDR: Media Kraken should work with new servers now :). Let me know if there's any issues. After some more tinkering, I decided to use DPoP by default and allow users to switch the authentication method if they want. It seems like it is too difficult to know whether a server supports DPoP or not, and most servers should already support it so I think this is a good compromise. As per the refresh problem, I still haven't seen any movement in Inrupt's issue and I'm not sure of when it'll be fixed. So I decided to go ahead with a simple UI that remembers the url so that users can log in again without too much hassle. Since we're talking about Inrupt's PODs, I'll also mention a problem I found that could be an issue for heavy users of the application. It seems like listing container resources doesn't return their modified date, and that's what I was using to know whether a movie has been updated or not since the last log in. The consequences of this is that I have to request all the movies every time the application starts, and if a user's got many movies that will make the app unusable. I'll see what I can do about this. |
The auth library solid-auth-client doesn't work with the newer Solid servers (e.g. Inrupts Enterprise Solid Server, the Community Solid server). I recommend switching to Inrupts Solid auth client, using the @inrupt/solid-authn-client-browser package. It works for both old and new Solid servers, and the APIs should be very similar.
The text was updated successfully, but these errors were encountered: