Feedback requested for a new authorization library

Hi, I’m working on a lightweight browser http client that supports oauth2 and openid-connect using a middleware approach. Recently I got it far enough to authenticate/authorize me to fetch a resource from the solidcommunity.net storage server.

You can find it here: https://github.com/muze-nl/metro-oidc

The size of the complete library, with openid-connect, is now at about 36KB minified, which is quite a bit smaller than the alternatives.

It also implements OAuth2.1, including PKCE and DPoP. It is still experimental though, so there are probably bugs.

I hope some of you are willing to try it out, and let me know the results.

regards,
Auke van Slooten
muze.nl

3 Likes

Hey, it’s great to see people working on new Auth libraries :D. However, I’m not sure I can try yours because it seems to be coupled to MetroJS. How hard do you think it would be to make this available for any JS application?

In any case, just looking at the example in the README, I can already spot some improvements. It seems like once you’re authenticated, you have to call client.get to make a request. But most high-level libraries that work with RDF and Solid usually expect a fetch callback (see examples in rdfjs.dev). I wonder if you could expose a function that takes the same arguments as fetch, and adds all the authentication headers on the request, etc.

2 Likes

Hi Noel,

@muze-nl/metro is the http client, @muze-nl/metro-oidc is a middleware plugin for that client. I may reconsider the name ‘metro’ if it isn’t clear enough :smiling_face:

there is a metro.client().fetch() function that is 100% compatible with fetch(). Its a recent addition, so I haven’t added it to the documentation yet.

regards,
Auke van Slooten
Muze

3 Likes

I’ve given it a try, but it’s not working for me. I opened an issue in github so we can continue the discussion there: Invalid grant for /token call · Issue #1 · muze-nl/metro-oidc · GitHub

I also noticed that the package doesn’t have Typescript declarations, so that would be another thing to improve :).

1 Like