如何构建链接到Active Directory的模型和控制器? [英] How to build a model and controller linked to Active Directory?

查看:96
本文介绍了如何构建链接到Active Directory的模型和控制器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,我一直在开发我最初选择的ASP.NET Web API,没有身份验证。



现在我被要求实现身份验证和使用Active Directory的授权。



我从来没有听说过Active Directory ......但是现在我一直在网上看一些关于它是什么的指南以及如何使用它从我的角度来看它似乎相当复杂......



我有一台电脑(除了我的电脑,但是通过一个开关连接到它) )在其中运行虚拟机并且我有一个服务器管理器,在其中我可以找到包含用户和计算机示例的Active Directory域服务,以便我可以在使用真实内容之前测试连接并构建代码。 br />


事情是,即使在阅读了所有这些指南并询问后,我仍然不知道从哪里开始实施身份验证。



是不是可能e只有2个变量(名称,密码),将其发送到Active Directory服务器以检查它们是否存在以及它们具有哪些权限并返回 - >如果确定权限(另一个变量)否则不行?或者按照这些方法进行操作?



我问这个是因为我的应用程序大部分是用Ember构建的,而且我传递这些值会更容易通过控制器REST API风格。



请帮助我开始,如果我的建议是愚蠢的,请建议我应该如何做。



PS:我是一名实习生,在没有任何帮助的情况下独自在整个应用程序上工作(怜悯!;))。

Hey guys, I've been developping an ASP.NET Web API that I initially chose with no authentication.

Now I've been asked to implement authentication and authorization using Active Directory.

I had never even heard of Active Directory until then... but now I've been looking at some guides online about what it is and how to use it and it all seems rather complicated from my point of view...

I was given a computer (besides mine but connected to it through a switch) in which a virtual machine is running and there I have a Server Manager in which I can find my Active Directory Domain Services that have examples of users and computers so that I can test the connection and build the code before using the real thing.

The thing is, even after reading all those guides and asking around I still have no idea where to even start to implement the authentication.

Isn't it possible to just have 2 variables ("name", "password"), send it to the Active Directory server to check if they exist and what permissions they have and have return --> if ok the permissions (another variable) else not ok? Or someting along these lines?

I'm asking this because the bulk of my application in being built in Ember and it would be really easier for me to pass these values through the controller REST API style.

Please help me to get started and if what I'm suggestion is stupid please suggest how I should do it.

PS: I'm an intern left to work alone on an entire application with no help (have mercy! ;) ).

推荐答案

我建​​议你阅读: http ://stackoverflow.com/questions/4453801/check-userid-exists-in-active-directory-using-c-sharp [ ^ ]。我不确定这符合你的标准,但......这是一个想法。似乎,您不必从用户那里获取用户名和密码。您必须从OS变量(实际记录的用户)中只读取用户名。按照那里提供的链接。
I'd suggest to read this: http://stackoverflow.com/questions/4453801/check-userid-exists-in-active-directory-using-c-sharp[^]. I'm not sure that meets your criteria, but... it's an idea. Seems, you do not have to get user name and password from user. You have to read only user name from OS variables (actually logged user). Follow the link provided there.


这篇关于如何构建链接到Active Directory的模型和控制器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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