如何使用iOS应用程序进行身份验证到Active Directory

编程入门 行业动态 更新时间:2024-10-28 16:26:40
本文介绍了如何使用iOS应用程序进行身份验证到Active Directory的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想创建和iOS应用程序,需要用户凭据,并与AD服务器进行验证。有一些建于X code库要做到这一点,或者是第三者?

I am trying to create and iOS app that takes a users credentials and verifies it with the AD server. Is there some built in library in xCode to do that, or is it third party?

在向任何意见,看看会大大AP preciated。

Any advice on direction to look would be greatly appreciated.

谢谢 扎克

推荐答案

好了,这是我用来做连接到LDAP服务器的PHP。我不是100%肯定,这里发生了什么,我得到这个code从IT协调员在我的公司。我了解所有的约束力和搜索部分,但我没有得到这整个事情的ldap_set_option一部分。无论如何设置它这种方式后,就可以调用PHP脚本的URL,并把它传递参数。看看PHP的,和URL例如用低于。

Ok, so this was the PHP i used to make the connection to the ldap server. i am not 100% sure what is happening here, i got this code from IT Coordinator at my company. I understand all the binding and searching parts, but i dont get the the ldap_set_option part of this whole thing. Anyway after setting it up this way, you can then call the URL of the php script and pass it parameters. take a look at the PHP, and the url example with be below.

    

<?php //Connection parameters $dn = "DC=network,DC=net"; $host = "ldap://ldapwork"; $port = 1111 $user = $_GET['user']; $pass = $_GET['pass']; //$user = "user@network"; //$pass = "pass"; $filter = "memberof"; $keyword = "CN=USSC_ALL,CN=Users,DC=network,DC=net"; $filter = "objectclass"; $keyword = "user"; $filter = "objectcategory"; $keyword = "CN=Person,CN=Schema,CN=Configuration,DC=network,DC=net"; //The real thing with PHP if (!empty($keyword) and !empty($dn)) { //Connect to the AD $adConn = ldap_connect($host, $port) or die("Could not connect!"); //Set protocol verison ldap_set_option($adConn, LDAP_OPT_PROTOCOL_VERSION, 3) or die ("Could not set ldap protocol1"); //Set referrals... Won't work without this... ldap_set_option($adConn, LDAP_OPT_REFERRALS, 0) or die ("Could not set ldap protocol2"); //Bind the user $bd = ldap_bind($adConn, $user, $pass) or die ("Could not bind"); echo $bd; //End binding ldap_unbind($adConn); } else { echo "<p>No results found!</p>"; } ?> </body> </html>

确定,所以现在所有你需要做的就是通过一个用户名和密码的脚本,它将返回绑定。这将使你真或假。这意味着,如果它成功地约束是用户名和密码的正确组合。

Ok so now all you have to do is pass a username and password to the script and it will return the bind. that will give you either true or false. meaning if it bound successfully it is a correct combination of username and password.

这是我如何调用它:

192.268.192.1/ldap.php?user=(username here)&pass=(password here)

这是我采取的方法,我认为这是一个非常简单的答案。

This is the approach that i took, and i think it is a very simple answer.

更多推荐

如何使用iOS应用程序进行身份验证到Active Directory

本文发布于:2023-11-14 08:51:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1586762.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   应用程序   身份验证   Directory   iOS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!