codeforpdx / PASS

PASS project - with HMIS module integration
MIT License
28 stars 25 forks source link

[Enhancement] - Simplify the add Contact Form to only provide the username to look up the webid #598

Closed DionSat closed 6 months ago

DionSat commented 7 months ago

Describe the Current Behavior/Feature:

In its current form PASS is still not very user friendly. You have to provide the whole web Id from the https to the #card to lookup the user. This is mainly for cases where the pod servers are different and URL needs to be changed to fit those pods.

image

Proposed Changes:

One approach is to:

Possible Drawbacks:

Discuss any potential drawbacks or negative impacts this enhancement might have, including:

Alternatives Considered:

Mention any alternative solutions or enhancements you've considered. Why were they not chosen or why are they less desirable than your proposal?

timbot1789 commented 7 months ago

The selection you describe could be powered by the VITE_SUGGESTED_OIDC_OPTIONS environment variable, the same thing that powers the login selector.

The problem then becomes recording the WebID format of each OIDC provider, but there are a lot of solutions to that.

DionSat commented 7 months ago

@timbot1789 Thanks for letting me know. I'm glad to know something like that already exists. As for the WebID format I'm not quiet sure how to approach that. I know the WebID format of community solid server and localhost and inrupt provides details about their own format from PodSpaces, but I'm not sure about the opencommons. I'm also trying to see if their is a easier way to do this then just hardcoding it. Like is their is a method to request the WebID from pod by providing just the username.

timbot1789 commented 7 months ago

Good questions.

As for the WebID format I'm not quite sure how to approach this

It's seems you have a handle on the concept, but just to make sure we're clear: the only requirement for the webID format is that it's a valid URI. Beyond that the solid provider may format their webIDs as they see fit.

I'm not sure about the opencommons one.

OpenCommons is our own server, so we can set it to anything we like. I'm actually not sure if it's up right now, but it was using the suffix format of community solid server.

Is there a method to request the WebID from pod by providing just the username

There is not. Discovery in Solid goes in the other direction. You get someone's WebID document, and then use that to find their pod. The pod location is recorded on their WebID documents.

Note: In Community Solid Server's upgrade to v7, they have actually made WebID formats more configurable. They have 2 options out of the box: Suffix: https://podhost.com/<username>/profile/card#me Subdomain: https://<username>.podhost.com/profile/card#me You can see their configuration generator here.

The only other format for a webID I've seen is when there is only one pod at a website. The webID then looks like this: https://<username>.com/profile/card#me. This is technically a special case of the subdomain format. I don't think we really need to handle this case, but a general enough solution may be able to take care of it alongside everything else.