-
Notifications
You must be signed in to change notification settings - Fork 18
Difficulty in implementing application flow #35
Comments
So, let's take a step back to see what it is that you really want to do. It seem to me that you want a server to be able to perform authenticated resource access, right? Down the road, this will be addressed with OAuth2 application tokens. But this has not been implemented yet. In the meantime, you can use this hack: https://github.com/jeff-zucker/solid-file-client
Security measures (token expiration) will purposely prevent you from doing that. |
can you elaborate or link to what you mean here? i'm not sure what an "OAuth2 application token" is. are you talking about offline refresh tokens, "service accounts", some kind of privileged meta-account that can act as another/any user at that OP, ...? |
@RubenVerborgh sorry, i still don't understand. assuming you're referring to the "Application-only authentication" mode on that page (since the "Application-user authentication" case is substantially the same as OIDC), for the decentralized Solid use case, wouldn't "app-only" access just be implemented by the app having a webid (that is, it's a bot), and granting access to the app's webid in ACLs? that also works for also the "app-only" case on that page doesn't address the "app wants to act as the user even if the user is offline" situation, which i believe is the use case @SimonShapiro is talking about. |
To be honest, I'm not (trying to be) an expert in this matter; I'm merely echoing the high-level plan that I've heard. Bots with WebIDs already sound good, but we haven't figured out the auth details for them (currently it's username/password with cookies). But even if a bot has its own WebID, it would still be good if they could use something like an app token and secret, such that they act on behalf of a user. So application-user authentication is the way (or something along those lines). |
all you need is for the app/bot's webid to list a that should work today. |
Good point, indeed. Should work, just needs implementation. |
it looks like NSS (at least running on solid.community) only does an this looks like an NSS bug. it will probably affect anyone whose webid document is hosted somewhere that didn't answer the expected
and saw only this in my web server logs (duplicate fetches removed):
when trying to use my "bot" https://zenomt.zenomt.com/bot/card.ttl#me and for the curious, here is the (expired) bearer token used with the above exchange:
this is the tool i whipped up to generate the above token. luckily it looks like NSS didn't mind that the .well-known/openid-configuration was application/octet-stream instead of application/json. :) nginx doesn't have a way to set a content-type on a file without an extension (without setting the default content-type for everything in a directory). i plan to do some more checking before i open a bug against NSS, to make sure i'm not doing something wrong. |
from source code inspection, i've found at least one bug in NSS (oidc-auth-manager) and one misfeature. bug: oidc-auth-manager https://github.com/solid/oidc-auth-manager/blob/5827449e0d1d287668fff667661003e529eb8f9d/src/preferred-provider.js#L70-L73 drops any path part of an OIDC issuer URI, so it can never successfully match an id_token's misfeature: only one i'll open a bug and enhancement for these two against oidc-auth-manager this weekend. just from code inspection i still don't know why it won't load my profile document after doing an OPTIONS on it. |
the tool i wrote can generate a usable access token if the issuer URI has no path part. as another annoyance: NSS seems to cache some representations (like for the openid-configuration and jwks_uri) for way too long, and appears to ignore the Cache-control header. i have "Cache-control: max-age=60" on responses for those but NSS doesn't seem to reload them even after a day+. |
I use
solid-auth-client
as the mechanism to authenticate users and the app to access their PODs. I understand that once authenticatedsolid-auth-client
places an object that is used later for interacting with their PODs into local storage. When I interact with the POD from the client usingsolid-auth-client
everything works ok in spite of the app being built in Python and compiled to Javascript via Skulpt.I am trying to re-use the
solid-auth-client
object from the browser by passing it on to the server so that the server can independently access the POD. There are many obvious use cases for this pattern. For example, I log in to the app and ask it to access my POD every night and send watermarked thumbnails of all new photos to an aggregator.My choice of using Python wherever possible may have inter-op issues with the object in local storage, but theoretically shouldn't. I have been trying to follow the pattern set out in the updated spec for
Sending a Request
.The authentication details are retrieved from
localStorage
with a javascript function:When the authentication details are passed to the Python server from local storage, it is held in a variable called
solid_auth_client
. First I set up the pop_token as a json object:I then retrieve the
private_key
fromsolid_auth_client
and convert it toPEM
format:I use the PEM version of the key to sign the
jwt
of thepop_token
:Finally, I use the
pop_token
as an authorization header in thehttp GET
from the PODs private area.This results in
HTTP error 401
.The text was updated successfully, but these errors were encountered: