Using Flat Files for authorization instead of using database tables

454 views Asked by At

I have an mvc4 application which use sql database as back end. I am using asp.net identity for authentication and authorization. I have a need to move some of the user settings/configuration from database to flat files. The current system stores user configuration in tables which we do not want to share with customers. This information must be maintained in flat files and be written in the directory where the code is executed. I need to come up with a .NET MVC prototype which can store/retrieve user configuration from a flat file.

Basically, I need that instead of using the database for authorization for storing and checking what users have access to what features etc. I can store in a flat file and load that into memory and use that to check for authorization for granting users access to different features. Also when the admin changes users authorization stuff it should update the file.

Can anyone please suggest me some scenario.

1

There are 1 answers

2
jay On

You can look into using files as Resources in your code. Resources can be accessed, read and updated at run time. And these will not be exposed to the users. Some links which might help.

https://stackoverflow.com/a/1533984/689625

https://stackoverflow.com/a/20908560/689625

https://msdn.microsoft.com/en-us/library/7k989cfy%28v=vs.90%29.aspx