Have you ever had the need to use Google Authentication, but for whatever reason, you could not use entity framework. This blog shows how to do just that but use ADO.Net with stored procedures.
The blog will also show you how to encrypt user emails and store them in your database. I will show you two ways of doing this, one using Effortless.Net.Encryption a Nuget package and then use ProtectedData Class which can be found in the System.Security.Cryptography namespace under the System.Security Assembly.
The blog will also show have to create a cookie using Owin to only allow visitors to view sections of your site when they have logged in.
The first thing that we need to do is create a project in Visual Studio, and then add the class libraries that the project will need.
For this example, I have createdthe following class libraries:
I then added the following packages that I required.
For this project I used:
Once everything is set up, I created the model for the site.
Once the models have been created, we now need to create the Controllers for the site. For this example, I had three:
I will only show the code for the account and base controller as the home controller only displays the home page.
So far I have shown you the models for the site and controllers, in the next blog, I will show you how to pass the data to the database and encrypt the email and hash the password.
If you have any queries, please use the form below.
Thanks for reading.