Using ThreeFold Connect App and Digital Twin for authentication & more

I programmed a web app a couple of years ago that I would love to move from a traditional hosting provider over to the ThreeFold Grid. In this process I want to rework some of the source code and overall system architecture to do as much as possible in the “ThreeFold way”.

I’ve been able to successfully use TF-Connect to login to an owncloud instance that I deployed on testnet. So there certainly seems to be a working interface for user authentication on TF Connect.

Now I’d love to implement TF-Connect authentication for my own web app.
Is there any up to date documentation that I can use as guidance on the topic?

Furthermore I’d love users of my web app to be in full control of any user data that is created when they are using my web app. I believe the concept of a digital twin is what can help with this. I am unsure whether or not the concept of a digital twin is mature enough to be implemented for production applications right now. I see two different ways that securing user data could potentially be implemented:

  1. User data is directly stored within the data storage of each digital twin that signed up to my app, limiting any access for myself (the developer) or third parties

  2. User data is stored in a centralized/distributed database (hosted on the TF Grid), but encrypted by means such that only the user authenticated via TF Connect is able to decrypt his own user data locally on his device, without relying on additional passwords.

I hope to be able to find time to work on all this over the holiday season, so any tips guides and references on how I might be able to achieve those two goals are highly appreciated. If I am able to get it done I will take down my current deployment and educate my (very small) user base how they can keep using my app the “ThreeFold way”.

Hi Jakub,

There was an answer to you question in the Telegram group from @Ken

I am sure @Ken can help you of you hit any hurdles… :slight_smile:
Happy programming!

Huraay, an actual javascript sdk for ThreeFold Connect authentication. That’s exactly what I was hoping for. As @Ken has already stated in the Telegram group “Documentation definitely still needs improvement on that process though”.

As I’ve stated before in a different thread:

So if I am lucky, the documentation will be updated before the holiday season. Otherwise I’ll just give it my best shot Maybe those public implementations of TF-Connect auth can help me for orientation. I’ll report back afterwards.

Regarding keeping users of my web app in full control of their data… Anybody know if Freeflow could be of any help in achieving this goal? If possible I’d like to migrate user data from my CouchDB over to the digital twin somehow (if thats even a desirable use case for digital twins).

From what I can read on the Freeflow Github Repository I don’t think this is possbile atm.

Maybe as an alternative TF-Connect can provide some kind of secured encryption key that authenticated users can use to encrypt their data before I put it on my rather centralized DB. Or there is a third way I haven’t thought of yet. @Ken you seem like the expert on this toptic. Could you give some insights on whats currently possible or planned?

What is your web-app and what is it doing today? Please send me some info (DM if you prefer, otherwise here). Once I understand better what it is doing, I’ll try to point you in the direction where ThreeFold can help you. :rocket:

I programmed a web app (pwa) to plan my daily life, create appointments, todos or reminders. Using calendars for those small things always seemed overkill to me, while most Todo-Apps didn’t really satisfy me either. You can check it out at https://weekme.app if you like. You can just use any made up email address for signup (it’s not being verified). Google Login is also possible, but I want to replace that with TF Connect login.

User data is stored in JSON format inside a No-SQL database (CouchDB). I am open to modify this, as long as I can keep my app working without internet connectivity. Not sure a digital twin can help with safe data storage within DBs. But as I’ve said, encrypting user data inside the existing DB with a key provided by TF connect would also be totally acceptable (but I won’t learn anything about digital twins in the development process)

Just head about BCDB, maybe that would be another possibility to safely store user data.