Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let users log into Smoothie #700

Closed
Tracked by #655 ...
teolemon opened this issue Nov 27, 2021 · 8 comments · Fixed by #742
Closed
Tracked by #655 ...

Let users log into Smoothie #700

teolemon opened this issue Nov 27, 2021 · 8 comments · Fixed by #742
Assignees
Labels
👥 User management Account login, signup, signout

Comments

@teolemon
Copy link
Member

teolemon commented Nov 27, 2021

What

Let users log into Smoothie
https://github.com/openfoodfacts/openfoodfacts-dart/blob/master/DOCUMENTATION.md#check-login-data

Part of

@teolemon teolemon added the 👥 User management Account login, signup, signout label Nov 27, 2021
@monsieurtanuki
Copy link
Contributor

I suppose we'll have to store the password locally.
How do you guys do that in the 100% Android app? I mean, storing it in clear in the preferences wouldn't be 100% safe. Unless we assume that we can survive if an OFF account gets hacked.
@stephanegigandet @teolemon ?

@M123-dev
Copy link
Member

M123-dev commented Dec 6, 2021

@monsieurtanuki , that's a further reason why I'd recommend Hive (doesn't matter if for all or only for preferences and this). It has some basic encryption at it's core but it also has secured Boxes where you can provide some further encryption. But we'll have to check how it really works

@monsieurtanuki
Copy link
Contributor

@M123-dev We did share views about databases in general and hive more specifically in #470. The issue is on the shelf as it did not draw that much interest, unfortunately. Which is a pity before Smoothie actually goes live, because changing DBs on a live app is quite a challenge!
That being said, we're talking about open source code: the cyphering algorithm can be read by everybody. And I don't know how easy it is for malicious developers to access whatever cyphering keys we will need and store on the device.

@M123-dev
Copy link
Member

M123-dev commented Dec 6, 2021

Yes I know @monsieurtanuki we should probably reactivate the discussion...

On Android, we can decide where to store the data

  • public: In the open file system
  • private: Only accessible by the app itself and the user
  • secured: Even hidden from the user

(They are named differently and this doesn't apply for rooted devices)

The DB is very likely in private and the preferences in secured so I don't worry so much about that. For iOS, it's probably even stricter.

@monsieurtanuki
Copy link
Contributor

You're right, that's probably OK like that so because even on a rooted device the worst that could a user do would be a self-hack! Unless of course the smartphone is given temporarily to a "friend". I had a slightly different issue on another app where I wanted to store the number of purchased credits in the preferences - on a rooted device the user would be able to add credits by directly changing the preferences.

Actually, we don't even have a problem with preferences (deemed "secured"), do we?

@M123-dev
Copy link
Member

M123-dev commented Dec 6, 2021

Now thinking about it that way, it should be allright

@M123-dev M123-dev self-assigned this Dec 11, 2021
@M123-dev
Copy link
Member

@monsieurtanuki, now after the switch to hive where would be the correct way to write the logic, should I create a own DaoCredentials or a somewhat more generic DaoString or DaoSecuredString

@monsieurtanuki
Copy link
Contributor

Hi @M123-dev!
It looks like the encryption on hive is at the "box" level, therefore it would indeed make sense to create a dedicated DaoSecuredString class with a dedicated box.
But in a first step I would put it simply in the preferences: as already said preferences are relatively secure, and all the tap dancing you put on encryption will be visible in the code anyway as we're open source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👥 User management Account login, signup, signout
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants