Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi guys,

I have asp.net website in c#.

and the requirement is to login via own domain authentication.

i have done with google authentication using its api, client id and secret.

But i dont know how to do authentication with our own domain.

Can any one please help me.


Thanks
Posted

1 solution

Let me tell you what is login system, or authentication system. A user comes to your web app, gives you his username and a secure string that only your system or user knows. Later when he comes back, he provides the username and the secure string (known as password) and the system (if both are correct) logs him in. A simple login system (without any security, and features) can be developed using the following code...

C#
string username = "<get-username>";
string password = "<get-password>";


/*
 * assume savedUsername and savedPassword come from a database
 */
if(username == savedUsername && password == savedPassword) {
   // save a cookie for the user
} else {
   // Wrong details
}
</get-password></get-username>


There. No one can say that this isn't what a login system does. Other login systems do is something that provides security to your credentials such as password hashing (it is required, do not store passwords without hashing them). Now if you have understanding of how a language works, you will be able to define a structure of your own.

You can also use ASP.NET Identity if you want to. It would provide you with basic implementation of login authentication system and is free of cost for ASP.NET.

Also, if you still want to create your own, please give a look at the Login system that I have created that uses JSON files as data source and creates a very basic login system. Get it on GitHub[^]... Or you can get it from NuGet[^] also,

PM> Install-Package LoginKeys
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900