[OpenVPN home] [Date Prev] [Date Index] [Date Next]
[OpenVPN mailing lists] [Thread Prev] [Thread Index] [Thread Next]
Google
 
Web openvpn.net

Re: [Openvpn-users] Password-based authentication on Windows?


  • Subject: Re: [Openvpn-users] Password-based authentication on Windows?
  • From: "Artur Rodrigues" <arturlr@xxxxxxxxx>
  • Date: Wed, 6 Sep 2006 14:09:22 -0300

I have wrote a vbs script that has been working nicely so far.
 
In the server config add the following line:
auth-user-pass-verify "D:\\OpenVPN\\config\\authAD.vbs" via-file
 
As a side note, the script failed when I had openvpn in the \\Program Files\\Openvpn, for some reason auth-user-pass-verify doesn't like space in the pathname.
 
here it is the script:
----
Dim fso
Dim f
Dim strUsername
Dim strPassword
Dim strarq
dim erro

Const ADS_SCOPE_SUBTREE = 2

On Error Resume Next

Set objArgs = WScript.Arguments
'Dim fsow, tf
'Set fsow = CreateObject("Scripting.FileSystemObject")
'Set tf = fsow.CreateTextFile("c:\output.txt", True)

Set fso = CreateObject("Scripting.FileSystemObject")
strarq = objArgs(0)
'tf.WriteLine(strarq)
If fso.FileExists(strarq) Then
   Set f = fso.OpenTextFile(strarq, 1)
   strUsername = f.ReadLine
   strUsername = "CONTOSO\" + strUsername
'tf.WriteLine(strUsername)
   strPassword = f.ReadLine
f.close
end if

Set objConnection = CreateObject("ADODB.Connection")
Set objCommand =   CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"

objConnection.Properties("User ID") = strUsername
objConnection.Properties("Password") = strPassword
objConnection.Properties("Encrypt Password") = TRUE
objConnection.Properties ("ADSI Flag") = 1

objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection

objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.Properties("Sort On") = "Name"

objCommand.CommandText = _
    "SELECT Name FROM 'LDAP://dc=contoso,dc=com' WHERE objectCategory='user'" 
Set objRecordSet = objCommand.Execute

if Err <> 0 Then
   erro = 1
else
   erro = 0
end if

wscript.quit (erro)



 
On 9/6/06, Ken D'Ambrosio <ken@xxxxxxxx> wrote:
I've perused the docs, and don't see what (if any) mechanism can be used
for username/password-based authentication for a Windows/Windows
connection.  Is there a way to do it?

Any pointers would be *greatly* appreciated.

Thanks,

-Ken D'Ambrosio



-------------------------------------------------------------------------

Openvpn-users mailing list
Openvpn-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/openvpn-users


-------------------------------------------------------------------------
Get stuff done quickly with pre-integrated technology to make your job easier
_______________________________________________
Openvpn-users mailing list
Openvpn-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/openvpn-users

Warning: require_once(../../../archive_common.php) [function.require-once]: failed to open stream: No such file or directory in /home/openvpn/domains/openvpn.net/public_html/archive/openvpn-users/2006-09/msg00046.html on line 203

Fatal error: require_once() [function.require]: Failed opening required '../../../archive_common.php' (include_path='/usr/local/lib/php') in /home/openvpn/domains/openvpn.net/public_html/archive/openvpn-users/2006-09/msg00046.html on line 203