0

I am creating a MVVM application and the basic system allows a user to register, login, and add data to a database.

There are multiple users, so I want the system to be able to maintain the user's credentials/state after they login and have the application open.

So far I haven't been able to find any good tutorials online to advise me about this, so if anyone knows any or knows of a way to do this I would really appreciate some help.

Thanks.

RebeccaD
  • 143
  • 5
  • 12
  • This is too braod. What are your specific questions? If you are simply looking for a mvvm tutorial, this is the wrong place. Please show us some of your code. – LuigiEdlCarno Nov 04 '13 at 14:57

3 Answers3

1

You can use application settings as a store for user state and credentials. To store settings in user's profile, you should set corresponding scope for each setting you'll define.

Consider settings as a part of application model (Model in MVVM). Build model when starting application, using application settings, and save it on application shutdown.

Also, do not store passwords in clear text. Use ProtectedData to encrypt and decrypt passwords.

Dennis
  • 37,026
  • 10
  • 82
  • 150
0

Use cookies or local storage are 2 things that jump out to me.

dex412
  • 519
  • 4
  • 5
0

Simply, after receiving the username and password of the user, if the credentials are correct generate a guid and save it to db for that user and add this guid in cookies also. And on every request search the guid value in db and authorize the user if the guid is existing.

mehmet mecek
  • 2,615
  • 2
  • 21
  • 25