LDAP Authentication in classic asp

I have LDAP Authentication for my ASP site. Code is working fine on Windows 2003 Server. However we need to migrate our application to Windows 2012 R2 server.Unfortunately, the same is not working Error comes as "Server is not in operational."

Below is my code. Kindly advise for the same

Function AuthUser(strFSUID, strPwd) Const ADS_FAST_BIND_SSL = 34 'forces fast binding and SSL connection Const strADSPath = "LDAP://mdsoti.fsu.edu:636/ou=People,dc=fsu,dc=edu" 'full path to LDAP server Const strProxyUser = "proxy-user" 'proxy username For establishing initial connection to LDAP Const strProxyPass = "proxy-pass" 'proxy password For establishing initial connection To LDAP Dim conADODB 'LDAP admin connection Dim comADODB 'User DB connection Dim rsLDAP 'recordset to hold user information Dim dsoLDAP 'LDAP system object Dim conUser 'LDAP connection to validate username and password Dim strPath 'users FQDN path Dim strUser 'users dn stripped from ADsPath Dim blnAuthenticated 'has user been authenticated: 0 = no, -1 = yes On Error Resume Next blnAuthenticated = False 'Create our admin connection for retrieving user DN Set conADODB = CreateObject("ADODB.Connection") conADODB.Provider = "ADsDSOObject" conADODB.Properties("user ID") = "cn=" & strProxyUser & ",ou=proxy-users,dc=fsu,dc=edu" conADODB.Properties("Password") = strProxyPass conADODB.Properties("ADSI Flag") = ADS_FAST_BIND_SSL conADODB.Open "ADSI" 'next we get the users dn Set comADODB = CreateObject("ADODB.Command") Set comADODB.ActiveConnection = conADODB comADODB.CommandText = "<" & strADSPath & ">;(cn=" & strFSUID & ");Adspath,cn,;subtree" Set rsLDAP = comADODB.Execute 'finally, we validate the actual username and password While Not (rsLDAP.EOF) strPath = rsLDAP.fields("ADsPath") wscript.echo strPath 'strip out user dn from ADsPath strUser = InStrRev(strPath, "/") strUser = Mid(strPath, strUser + 1) wscript.echo strUser 'open connection to authenticate users FSUID and password Set dsoLDAP = GetObject("LDAP:") Set conUser = dsoLDAP.OpenDSObject(strADSPath, strUser, strPwd, ADS_FAST_BIND_SSL) 'see if the user's password worked. if not print error message If Err.Number <> 0 Then blnAuthenticated = False Else blnAuthenticated = True End If v = rsLDAP.fields("cn") wscript.echo v(0) rsLDAP.MoveNext Wend AuthUser = blnAuthenticated End Function

Error comes while executing "Set rsLDAP = comADODB.Execute"

Thanks in adavance

Category:vbscript Time:2017-12-05 Views:1

Related post

  • Forms authentication for classic ASP on IIS 7.0 2010-06-08

    I am trying to integrate ASP.NET Security with Classic ASP. Like in next article - http://weblogs.asp.net/scottgu/archive/2007/03/04/tip-trick-integrating-asp-net-security-with-classic-asp-and-non-asp-net-urls.aspx, but I have IIS 7.0 instead of IIS

  • Mysteriously appearing required NT authentication after Classic ASP site update? 2009-03-18

    A developer posts their code from a staging site (which requires authentication) to the live public site (which should not) and suddenly the live site is requiring authentication (which is not good). They don't have permissions to change any settings

  • Facebook Server-side Authentication with Classic ASP 2012-01-27

    Similar to this closed question but I'll make mine more precise so hopefully there'll be an answer :) I'm adding Facebook login button to a website that's all in classic ASP, and I'm new to the Facebook SDK/API, and https ://developers.facebook.com/d

  • Connect to WCF Using Certificate Authentication in Classic ASP 2012-04-10

    I understand that Classic ASP is not a preferred language and that it should be abandoned. Those are certainly my thoughts. In any case, let's assume it's my only option. The Problem I have a WCF web-service written in C# hosted at some uri https://b

  • How to securely set up cookie-based authentication in classic ASP? 2011-08-04

    What would be the most secure method of using cookies to authenticate users in a classic ASP website? I don't want to use the ASP Session object as the session cookie times out after a while, and I'd like the user to be able to keep their login to th

  • Connect to SQL server (Windows Authentication) via Classic ASP 2011-04-26

    hey, I wanna connect to sql with windows Authentication either sql server authentication but frankly i can't : this is my connection string : <% Dim conn Set conn = Server.CreateObject("ADODB.Connection") 'conn.Open "Provider=SQLOLEDB; Data Source

  • Mixed Forms and LDAP authentication with auto-registration with ASP.NET MVC 2009-11-21

    I need to use Form-Based authentication on an ASP.NET MVC web site with LDAP (Active Directory) backend like TeamCity for instance. So i need to query LDAP first if the requested user is valid, then auto-register user in database according to LDAP us

  • Classic ASP sending email with SMTP Authentication 2010-02-17

    We have inherited a classic ASP site from a design agency who just wanted us to do a search and replace to change SMTP hosts. No problem, we are a PHP shop but can turn our hands to most things. On further investigation it was discovered that we need

  • How to get name of authentication cookie for current session in Classic ASP 2010-11-19

    Classic ASP creates cookies with name something like ASPSESSIONIDSSDSQQCR where suffix after "ASPSESSIONID" is different. If you work for some time with application browser keeps storing all previous session cookies (could be 10 cookies or more), so

  • Windows Authentication not working for classic ASP pages (but does work for ASP.Net pages w/in same site) 2011-08-16

    We have an IIS7 intranet site running under integrated pipeline that is mostly ASP.Net with a few legacy classic ASP pages. The site allows anonymous access to most areas, but uses Windows Authentication to protect certain folders. Requests to ASP.Ne

  • IIS7: classic ASP application write access to .mdb file using windows authentication 2011-10-03

    I have a classic ASP application I want to run on my website (IIS7). This site contains an .mdb database file. I have enabled windows authentication and disable anonymous under authentication. I want members of a certain domain group (TESTGROUP) to h

  • The same asp.net mvc page for LDAP authenticated and anonymous users 2011-12-26

    I have some intranet asp.net mvc3 app ,which is available for both LDAP authenticated and anonymous users.All of them are using IE. One of the views should be available for both of them, depending on status some columns should be hidden,etc. I don't

  • Connect to SQL Server database from classic ASP using windows authentication 2012-04-17

    I am normally a .NET developer so have no experience with classic ASP. I have been asked by a client to have a look at their classic ASP site. I am trying to recreate their site on my local machine so can have a play with but am having difficulty con

  • Are there benefits to Classic ASP over ASP.net 2008-09-05

    Having worked with Classic ASP for about 2 years now by creating a few 100 simple web forms I can't see a good reason for switching to .net; however, I'm not that versed in .net so I'm sure I could be missing a few things. Some points that I often he

  • Classic ASP On Server 2008 & SQL 2008 2008-11-19

    I am currently migrating one of my clients sites to a windows server 2008 and SQL 2008 setup, but I am having massive problems with connecting to the database from the site. I have restored the database from a SQL 2k backup into the SQL 2008 server,

  • Can a Classic ASP application be secured using HTTPModules? 2009-01-29

    I have a classic ASP application currently secured using ASP.NET Forms Authentication running on IIS 6, the problem is our purposes require this application implement a Single-Signon security model using Entrust TruePass which uses Client Certificate

  • Classic Asp Web Service Problem 2009-03-06

    I'm trying to create a code to allow an existing classic asp program to use an asp.net web service. Updating from the classic asp is not an option, as I'm working in a big company and things are the way they are. I've been browsing through a chunk of

  • How to guide for getting a classic asp application working under IIS 7.0 2009-03-12

    I am looking for a nice easy step by step "How To" guide for getting a classic asp application working under IIS 7.0. It is on a 64 bit windows server 2008 machine if that makes any difference. --------------Solutions------------- We've been moving s

  • Classic ASP RSS Reader not working on internal server 2009-03-19

    I've got a web-based RSS Reader written in Classic ASP that I've used successfully in public projects past. However, it does not want to cooperate on this in-house project. Pertinent Code: set xmlDoc = createObject("Msxml.DOMDocument") xmlDoc.async =

  • using system.web.authorization settings in web.config to protect classic asp files? 2009-05-12

    I've got a virtual directory with a vast subfolder hierarchy and thousands of classic ASP files, all of which have varying permissions set at the NT folder level (don't ask.. shakes head). Is there any way to setup all these virtual directories with

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.571 (s). 13 q(s)