{"id":544935,"date":"2010-04-27T03:00:00","date_gmt":"2010-04-27T07:00:00","guid":{"rendered":"tag:blogger.com,1999:blog-1652419620964346731.post-27261134227957925"},"modified":"2010-04-27T03:00:00","modified_gmt":"2010-04-27T07:00:00","slug":"how-to-make-osticket-1-6-0-authenticate-with-active-directory","status":"publish","type":"post","link":"https:\/\/mereja.media\/index\/544935","title":{"rendered":"How To Make osTicket 1.6.0 Authenticate with Active Directory"},"content":{"rendered":"<p>Back in September of last year I wrote up an article on <a href=\"http:\/\/www.bauer-power.net\/2009\/09\/how-to-get-osticket-to-authenticate.html\" >how to get osTicket to authenticate with Active Directory<\/a>. That article was based on version 1.6 RC5. It actually worked very well for my company. Users could simply login to the staff panel with their domain\\username credentials.<\/p>\n<p>Well, we started getting weird database errors recently, so I thought it might be good to move away from the RC5 version, and move to the final release. Well,  if you read the comments at the bottom of my previous article you will know that my customizations didn\u2019t carry over to the final release. That is ok though, because I found an even better and easier way to get osTicket to authenticate with AD. I got it working in about 2 minutes in Ubuntu Server 10.04.<\/p>\n<p>First you will need one little perquisite package, <strong>php5-ldap<\/strong>. Just run the following:<\/p>\n<blockquote>\n<p><span style=\"color:#0000ff;\">&gt;sudo apt-get install php5-ldap<\/span><\/p>\n<\/blockquote>\n<p>Next you will want to manually create a user with a username that matches active directory. For instance is your AD username is <em>jsmith<\/em> create a user in osTicket called jsmith and give it a temporary password of 123456 (Doesn&#8217;t matter because osTicket will look to AD right?)<\/p>\n<p>Once that is installed, edit <strong>include\/class.staff.php<\/strong>:<\/p>\n<blockquote>\n<p><span style=\"color:#0000ff;\">&gt;sudo nano include\/class.staff.php<\/span><\/p>\n<\/blockquote>\n<p>Replace the following code:<\/p>\n<blockquote>\n<p><span style=\"color:#0000ff;\">\/*compares user password*\/       <br \/>function check_passwd($password){        <br \/>    return (strlen($this-&gt;passwd) &amp;&amp; strcmp($this-&gt;passwd, MD5($password))==0)?(TRUE):(FALSE);        <br \/>}<\/span><\/p>\n<\/blockquote>\n<p>With:<a href=\"http:\/\/www.osticket.com\/\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;\" title=\"osticket\" alt=\"osticket\" src=\"http:\/\/lh6.ggpht.com\/_jLaEIqL6T8Y\/S9dPs4dHFCI\/AAAAAAAACYQ\/v2tSagX6EI4\/osticket%5B10%5D.png?imgmax=800\" align=\"right\" border=\"0\" width=\"251\" height=\"127\" \/><\/a> <\/p>\n<blockquote>\n<p><code><code><span style=\"color:#0000ff;\">\/*compares user password*\/           <br \/>function check_passwd($password){            <br \/>\/\/ Change made for LDAP Auth  based on -&gt; http:\/\/osticket.com\/forums\/showthread.php?t=3312            <br \/>        \/\/ Change this line to the FQDN of your domain controller            <br \/>$ds=ldap_connect(<span style=\"color:#ff0000;\"><strong>'mydc.mydomain.local'<\/strong><\/span>) or die(\"Couldn't connect to AD!\");            <br \/>\/\/ Change this line to the name of your Active Directory domain            <br \/>if ($ds) {            <br \/>$domain=\"<strong><span style=\"color:#ff0000;\">mydomain<\/span><\/strong>\";            <br \/>$ldapbind = ldap_bind($ds);            <br \/>            if (!@ldap_bind( $ds, $domain.\"\\\\\".$this-&gt;username, $password) ) {            <br \/>\/\/ Auth failed! lets try at osTicket database            <br \/>return (strlen($this-&gt;passwd) &amp;&amp; strcmp($this-&gt;passwd, MD5($password))==0)?(TRUE):(FALSE);            <br \/>\/\/ return(FALSE);            <br \/>}            <br \/>            else{            <br \/>\/\/ Auth succeeded!            <br \/>return(TRUE);            <br \/>            }            <br \/>\/\/ End Changes            <br \/>}<\/span><\/code><\/code><\/p>\n<p><code><code><span style=\"color: rgb(51, 51, 255);\">}<\/span><br \/><\/code><\/code><\/p>\n<\/blockquote>\n<p><code><code><\/code><\/code><\/p>\n<p><code><code><\/code><\/code><\/p>\n<p><code><code>After you do that change the items in red to match your environment then restart Apache:<\/code><\/code><\/p>\n<blockquote>\n<p><code><code><span style=\"color:#0000ff;\">&gt;sudo \/etc\/init.d\/apache2 restart<\/span><\/code><\/code><\/p>\n<\/blockquote>\n<p><code><code>Bam! You now have Microsoft Active Directory authentication, and you don\u2019t have to specify a domain name at login either!<\/code><\/code><\/p>\n<p><code><code>If you are looking for additional functionality, check out the osTicket Forums, there are a lot of cool customizations I am sure you will find useful!<\/code><\/code><\/p>\n<p><code><code><\/code><\/code><\/p>\n<\/p>\n<div style=\"padding: 0px; margin: 0px; display: inline; float: none;\" id=\"scid:0767317B-992E-4b12-91E0-4F059A8CECA8:cc4022df-3fc3-4979-94df-94ae20b88c63\" class=\"wlWriterEditableSmartContent\">Technorati Tags: <a href=\"http:\/\/technorati.com\/tags\/osticket\" rel=\"tag\">osticket<\/a>,<a href=\"http:\/\/technorati.com\/tags\/1.6\" rel=\"tag\">1.6<\/a>,<a href=\"http:\/\/technorati.com\/tags\/active+directory\" rel=\"tag\">active directory<\/a>,<a href=\"http:\/\/technorati.com\/tags\/authentication\" rel=\"tag\">authentication<\/a>,<a href=\"http:\/\/technorati.com\/tags\/how+to\" rel=\"tag\">how to<\/a><\/div>\n<div class=\"blogger-post-footer\"><Br \/><center><a href=\"http:\/\/www.anrdoezrs.net\/click-3773910-10438541?cm_mmc=CJ-_-2769020-_-3773910-_-Home_468x60-Anim_8-24-2006\" ><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.ftjcfx.com\/image-3773910-10438541\" width=\"468\" height=\"60\" alt=\"Great Deals @ Geeks.com!\" border=\"0\"\/><\/a><\/center><img width='1' height='1' src='https:\/\/blogger.googleusercontent.com\/tracker\/1652419620964346731-27261134227957925?l=www.bauer-power.net' alt='' \/><\/div>\n<div class=\"feedflare\">\n<a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:yIl2AUoC8zA\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=yIl2AUoC8zA\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:dnMXMwOfBR0\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=dnMXMwOfBR0\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:V_sGLiPBpWU\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=dQNtYYq0FKM:vumh7E9g2S4:V_sGLiPBpWU\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:gIN9vFwOqvQ\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=dQNtYYq0FKM:vumh7E9g2S4:gIN9vFwOqvQ\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:YwkR-u9nhCs\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=YwkR-u9nhCs\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:F7zBnMyn0Lo\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=dQNtYYq0FKM:vumh7E9g2S4:F7zBnMyn0Lo\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:wF9xT3WuBAs\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=dQNtYYq0FKM:vumh7E9g2S4:wF9xT3WuBAs\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:jTJX5pvEcCQ\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=dQNtYYq0FKM:vumh7E9g2S4:jTJX5pvEcCQ\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:TzevzKxY174\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=TzevzKxY174\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:qj6IDK7rITs\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=qj6IDK7rITs\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:7Q72WNTAKBA\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?d=7Q72WNTAKBA\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:nHK9nIK91uw\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=dQNtYYq0FKM:vumh7E9g2S4:nHK9nIK91uw\" border=\"0\"><\/img><\/a> <a href=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?a=dQNtYYq0FKM:vumh7E9g2S4:tdI4wLSbWXI\"><img decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~ff\/Bauer-power?i=dQNtYYq0FKM:vumh7E9g2S4:tdI4wLSbWXI\" border=\"0\"><\/img><\/a>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/feeds.feedburner.com\/~r\/Bauer-power\/~4\/dQNtYYq0FKM\" height=\"1\" width=\"1\"\/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Back in September of last year I wrote up an article on how to get osTicket to authenticate with Active Directory. That article was based on version 1.6 RC5. It actually worked very well for my company. Users could simply login to the staff panel with their domain\\username credentials. Well, we started getting weird database [&hellip;]<\/p>\n","protected":false},"author":1521,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-544935","post","type-post","status-publish","format-standard","hentry","category-news"],"_links":{"self":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/544935","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/users\/1521"}],"replies":[{"embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/comments?post=544935"}],"version-history":[{"count":0,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/posts\/544935\/revisions"}],"wp:attachment":[{"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/media?parent=544935"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/categories?post=544935"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mereja.media\/index\/wp-json\/wp\/v2\/tags?post=544935"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}