在asp.net c#中拥有自己的域身份验证 [英] Own domain authentication in asp.net c#

查看:72
本文介绍了在asp.net c#中拥有自己的域身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在c#中有asp.net网站。



和要求是通过自己的域身份验证登录。



i使用其api,客户端ID和密码进行谷歌身份验证。



但我不知道如何使用我们自己的域进行身份验证。



任何人都可以帮助我。





谢谢

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

推荐答案

让我告诉你什么是登录系统或认证系统。用户访问您的Web应用程序,为您提供他的用户名和只有您的系统或用户知道的安全字符串。后来当他回来时,他提供用户名和安全字符串(称为密码)和系统(如果两者都正确)将他登录。一个简单的登录系统(没有任何安全性和功能)可以使用以下代码开发...



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...

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>





那里。没有人能说这不是登录系统的功能。其他登录系统可以为您的凭据提供安全性,例如密码散列(它是必需的,不存储密码而不对其进行散列)。现在,如果您了解语言的工作原理,您将能够定义自己的结构。



如果您愿意,也可以使用ASP.NET身份。它将为您提供登录身份验证系统的基本实现,并且免费提供ASP.NET。



此外,如果您仍想创建自己的,请查看我创建的使用JSON文件作为数据源的Login系统并创建一个非常好的基本登录系统。 在GitHub上获取 [ ^ ] ...或者你可以从NuGet获取 [ ^ ]另外,





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


这篇关于在asp.net c#中拥有自己的域身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆