Jump to content

Recommended Posts

Posted

Was trying to launch Bluecoat application access via IE, which has windows authentication , i got it working to pass credentials but the access, after initial authentication has another java launcher for which i need to pass the credentials when the " Authentication Required " windows occur but there are 4 java security related windows appearing .My code so far is as below :-

 

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=ps_test.exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <Constants.au3>
#include <IE_v1.au3>
#include <AutoItConstants.au3>

If $CmdLine[0] < 2 Then
   MsgBox($MB_OK, "Usage", "ps_proxy <username> <password>")
Else
   Proxy($CmdLine[1], $CmdLine[2])
EndIf

Func Proxy($email, $password)
   Local $ie = _IECreate("https://1.1.1.1" , 1)
Local $oIE = _IEAttach("Cert")
_IELinkClickByText($oIE, "Continue to this website (not recommended).",0,0)
    If @error > 0 Then
      Local $i = 0

      Do
         Sleep(500)
         $i = $i + 1
         $ie = _IEAttach("1.1.1.1")
      Until VarGetType($ie) == "Object" Or $i >= 10
   EndIf

   If VarGetType($ie) == "Object" Then
      $hwnd = _IEPropertyGet($ie, "hwnd")
      WinSetState($hwnd, "", @SW_MAXIMIZE)
 Local $hWnd1 = WinWait("[CLASS:DirectUIHWND]", "", 10)
   ControlClick($hWnd, "", "DirectUIHWND1")

   ; Send the Username
   Send($email, 1)
   Sleep(10)
   Send("{TAB}")
   ; Ensure we are in the Password field

   ; Send the Password
   Send($password, 1)
   Sleep(10)
   ; Submit the credentials
   Send("{ENTER}")
    WinWaitClose($hwnd)
    Else
      MsgBox($MB_OK, "Login Failure", "Password Safe failed to automate the login. If this problem persists please contact your Password Safe Administrator.")
   EndIf
EndFunc ;==>Proxy()

 

Can I put the below for the code to run till the authentication required window applies and then to pass the credentials again ?

[CLASS:Authentication Required]", "", 5)
ControlSend("Authentication Required", "", "", "username{TAB}password{TAB 2}{ENTER}")

or should i use a while loop along with winlist ?and wait for windows to appear ?

  • Developers
Posted

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

  Quote

General development and scripting discussions. If it's super geeky and you don't know where to put it - it's probably here.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Expand  

Moderation Team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...