Accessing SOLID pod from a mobile application

Hi,

I am thinking of making an android mobile app for SOLID which lets the users to upload files from the smart phone to the SOLID pod. But not sure about the login process using solid auth client. Is there anyone developed/developing mobile apps using SOLID? It will be great if i could find a simple login demo app.

Hi @Leoudayan can’t you use webapp? Do you really need a native app?

1 Like

I have different ideas in my mind which actually require a native app. Thats why.

Have you tried using solid-auth-client within something like Cordova? You can write apps in html, css and js and have access to native device APIs. I didn’t try it, but I could imagine it to work.

1 Like

Thank you for this. I will give it a try and let you know.

Hi @Leoudayan, I’ve been trying really hard to integrate Solid with a .net application server side and it’s next to impossible. First of all, I had to use the solid-auth-client. The good thing is that it is 100% compatible with Open ID Connect and it does produce an authorization token. The bad part is that the node.js solid server will completely ignore my authorization token and rely on cookie based authorization and thus I always get a 403 - unauthorized error. I sifted through the node.js code and found out the hardway.

I decided to read/write to a public container within my POD and now I’m finding out that my Sparql queries are not working as expected. I haven’t even tried updating but I suspect they won’t work either.

If you do the JavaScript/React way, it does work pretty good but for the rest of us that are trying the traditional way we’re out of luck. The inrupt folks have stated that their focus is on the web client side.

I think if they want a greater adoption from the developer community they should at least give us the resources for us to close that gap.

My 2 cents.

3 Likes

I guess for now you could create a server based app but still use the REST API to talk to Solid pods?

My understanding is that it’s a feature to keep the server side standard and put business logic in the client, so this may be best anyway. The idea being that this makes it easier to separate data from apps, to keep the server interface standard and interoperable etc.

1 Like

My only issue with this approach is if the app supports various client types, eg. iOS, Android, React, it would make more sense to abstract the business logic on the server rather than re-writing them for each client.
In the good spirit of LDP, the data format must be RDF.

Give a try to Solidash
When logged, your friends name/friends must appear in ’ Name : Public with TRIPLEDOC’ like that

it’s a responsive webApp that should fit Android / iOS or Computer viewport.
Doesn’t it be what you want ?

1 Like

Hi @moisesj, Thank you for sharing your experience. Can you explain a bit more about “Javascript/React way” ? My first goal is to create a simple app which logs me into a solid POD and read contents from private folder. I want to do it as a Native app. For now i am exploring whether it is possible to do this using REST API. But based on what you saying, it is not possible to do the login part from the app? In this case, can i just write data to my public folder? If this doesnt work, I am thinking of setting up an express app and send the data to it first before the express app puts it in the POD (i think this might be possible as its a web app). But it will be really cool if i could talk to the POD directly from my phone.

@happybeing this might be a basic question but is it possible to use the REST API from android mobile phone to talk to solid pods as android supports REST?

@Smag0 Thanks for your reply. But, you cannot make your apps to talk to your POD in this way.

you can add note to your POD ??? isn’t it enough ? if not, what do you mean by “talk to your POD” ?

@Smag0 i can add note manually. But how to make an app to write note in the POD? Is that possible? Lets say, i have a notes app in my phone in which if i enter something, it have to sync with the notes file in the POD. Thats the kind of thing i am trying.

Sharing notes from your “native note app” to a web app could be possible https://chodounsky.net/2019/03/24/progressive-web-application-as-a-share-option-in-android/
and reverse too
sharing from web app to ‘native app’ https://developers.google.com/web/updates/2016/09/navigator-share

1 Like

I haven’t done any Android development but if your native app can do HTTP requests I think the answer has to be yes.

1 Like

Thanks for the links. Will try it.

@happybeing Great! will give it a try.

1 Like

It should be possible. I guess the trickiest part about it will be the authentication (ie something similar as solid-auth-client). After making sure that you are correctly logged in, the rest should be normal HTTP requests (with an authentication header).

1 Like

@A_A EXACTLY!! I was about to post it in here. When i send a POST request, i got 401 unauthenticated error. It returned an HTML page. At this point i am not sure how to handle the login part (display webpage and get signed ID token). I read the authentication part in solid spec (see below). This is the part i am struggling with now. @moisesj is this something you been through already?

The overall sign in workflow used by the WebID-OIDC protocol is as follows. For example, here is what happens when Alice tries to request the resource https://bob.example/resource1 .

  1. Initial Request: Alice (unauthenticated) makes a request to bob.example , receives an HTTP 401 Unauthorized response, and is presented with a ‘Sign In With…’ screen.
  2. Provider Selection: She selects her WebID service provider by clicking on a logo, typing in a URI (for example, alice.solidtest.space ), or entering her email.
  3. Local Authentication: Alice gets redirected towards her service provider’s own Sign In page, thus requesting https://alice.solidtest.space/signin , and authenticates using her preferred method (password, WebID-TLS certificate, FIDO 2 / WebAuthn device, etc).
  4. User Consent: (Optional) She’d also be presented with a user consent screen, along the lines of “Do you wish to sign in to bob.example ?”.
  5. Authentication Response: She then gets redirected back towards https://bob.example/resource1 (the resource she was originally trying to request). The server, bob.example , also receives a signed ID Token from alice.solidtest.space that was returned with the response in point 3, attesting that she has signed in.
  6. Deriving a WebID URI: bob.example (the server controlling the resource) validates the ID Token, and extracts Alice’s WebID URI from inside it. She is now signed in to bob.example as user https://alice.solidtest.space/#i .
  7. WebID Provider Confirmation: bob.example confirms that solidtest.space is indeed Alice’s authorized OIDC provider (by matching the provider URI from the iss claim with Alice’s WebID).