+ Post New Thread
Results 1 to 6 of 6
How do you do....it? Thread, Capture Current Logged on User and Pass to a Web Form in Technical; I am sorry guys, I've done a search and couldn't see on here - or on Google an easy to ...
  1. #1
    Freedom's Avatar
    Join Date
    Feb 2007
    Location
    England - Midlands
    Posts
    42
    Thank Post
    6
    Thanked 5 Times in 4 Posts
    Rep Power
    16

    Cool Capture Current Logged on User and Pass to a Web Form

    I am sorry guys, I've done a search and couldn't see on here - or on Google an easy to understand guide for my request - actually the teachers as they are going insane but

    Basically we are moving to a SSO structure within WCC and part of that is having global ids which move with the user throughout their education within WCC. This global id gives them access to a range of services using the Shibboleth SSO platform.

    We also use these global ids and passwords in AD.

    What I want to do is pass the current windows login details (preferably both username and password but I highly doubt the password bit is possible) to the Shibboleth webpage when they open it. I was going to do some form of AutoIT script, but I can't work out how to go about getting the windows username.

    Does anyone have any good ideas for this?

    The webpage requiring input is here Worcestershire Learning Gateway using the login link on the right. The page first asks for the username and then you submit and then it asks for the password. As stated I want to enter at least the username when prompted and submit the page so that they just have to use the password.

    Any help appreciated!

  2. #2
    Freedom's Avatar
    Join Date
    Feb 2007
    Location
    England - Midlands
    Posts
    42
    Thank Post
    6
    Thanked 5 Times in 4 Posts
    Rep Power
    16
    Seems I was being stupid as this is easy on first glance of my quickly done AutoIt script - just need to loop it!

    Code:
    ; Wait until the logon window shows itself...
    WinWaitActive("Login - Windows Internet Explorer","https://shibboleth.networcs.net/SSO/auth/networcs_auth2/index.php")
    
    ; Add a little delay to avoid lag in accessing the website.
    Sleep(500)
    
    ; Send the current logged on username to the form (which defaults to the username box).
    Send(@UserName)
    
    ; Send the enter key after another small delay to move to the password page.
    ; This is just so the user can see what has happened...
    Sleep(1500)
    Send("{ENTER}")

  3. #3
    TheLibrarian
    Guest
    Shouldn't you thank yourself for answering your own query?

  4. 2 Thanks to TheLibrarian:

    Freedom (16th February 2011), K.C.Leblanc (16th February 2011)

  5. #4
    Freedom's Avatar
    Join Date
    Feb 2007
    Location
    England - Midlands
    Posts
    42
    Thank Post
    6
    Thanked 5 Times in 4 Posts
    Rep Power
    16
    Can't so I thanked you instead

    I figured someone else may find the info useful. Will add a post with full code loop etc later...

  6. #5
    Freedom's Avatar
    Join Date
    Feb 2007
    Location
    England - Midlands
    Posts
    42
    Thank Post
    6
    Thanked 5 Times in 4 Posts
    Rep Power
    16

    Thumbs up OK - My Final Code for the Day

    Code:
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
    #AutoIt3Wrapper_icon=green_padlock.ico
    #AutoIt3Wrapper_outfile=User2Shibboleth.exe
    #AutoIt3Wrapper_UseX64=n
    #AutoIt3Wrapper_Res_Comment=A little script to sit and run in the background of child logons to automatically re-enter their globalid. This is a huge time saver especially for the younger children that can't type quickly.
    #AutoIt3Wrapper_Res_Description=Passes Username to a Shibboleth SSO Form
    #AutoIt3Wrapper_Res_Fileversion=1.3.1.2
    #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
    #AutoIt3Wrapper_Res_LegalCopyright=Alex 'Freedom' Haines
    #AutoIt3Wrapper_Res_SaveSource=y
    #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
    
    ; Start the main loop.
    Do
    
    	; Wait until the logon window shows itself...
    	WinWaitActive("Login - Windows Internet Explorer", "https://shibboleth.networcs.net/SSO/auth/networcs_auth2/index.php")
    
    	; Make sure this is the username window...
    	; WinWaitActive("Login - Windows Internet Explorer","Please enter your Username:")
    
    	; Add a little delay to avoid lag in accessing the website.
    	Sleep(500)
    
    	; Send the current logged on username to the form (which defaults to the username box).
    	Send(@UserName)
    
    	; Send the enter key to progress to the next page.
    	Send("{ENTER}")
    
    	; Display a message so the user knows what is happening.
    	MsgBox(0, "Shibboleth Logon Helper v1.3", "Hi " & @UserName &"! I noticed that you were trying to use a SSO service enabled website. To help out, I have already entered your username for you. Now all you need to do is put your password in.", 10)
    
    	; Wait for the user to finish entering their password and then loop.
    	; This helps stop us entering the username again by mistake as we can't differenciate the pages due to iframes!
    	Sleep(5000)
    	WinWaitClose("Login - Windows Internet Explorer", "https://shibboleth.networcs.net/SSO/auth/networcs_auth2/index.php")
    
    	; Sleep again and then loop to beginning to avoid double pasting etc.
    	Sleep(10000)
    
    ; End of the main loop.
    ; Exit the loop using 'ExitLoop' command.
    Until False
    Attached Files Attached Files

  7. #6


    Join Date
    Jul 2007
    Location
    Rural heck
    Posts
    2,662
    Thank Post
    120
    Thanked 434 Times in 353 Posts
    Rep Power
    126
    Quote Originally Posted by TheLibrarian View Post
    Shouldn't you thank yourself for answering your own query?
    I'm thanking you as well. You've just reminded me of a bloke I used to work with.

SHARE:
+ Post New Thread

Similar Threads

  1. pass user info to website
    By farmerste in forum How do you do....it?
    Replies: 17
    Last Post: 13th September 2012, 02:09 PM
  2. Replies: 5
    Last Post: 17th June 2010, 12:22 PM
  3. user logged in
    By firefighting in forum Scripts
    Replies: 1
    Last Post: 12th February 2009, 10:14 AM
  4. automatic VNC to PC a user is logged onto
    By ChrisP in forum How do you do....it?
    Replies: 2
    Last Post: 7th December 2007, 04:23 PM
  5. Replies: 5
    Last Post: 21st February 2007, 04:40 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •