Results 1 to 4 of 4
  1. #1
    nloding is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Default Send keystrokes to iframe

    So here's the basic concept of what my manager wants implemented for a secure site we have, and I'm not sure where to start other than a Java applet that runs in the browser:

    User clicks a link to "Management Center," which is a 3rd party webapp that uses different credentials and security than our portal page. We want the client to be automatically logged into the Management Center when they click that link.

    My thought is this: opens a new page, with an iframe that has the Management Center in it and a banner above the iframe (ala Google Images) that has a "return to portal" link or something. That page would run a (hopefully) transparent/unobtrusive Java applet, emulate keystrokes to the username and password text boxes in the iframe, and log the client in.

    Is it possible? Is it possible to send keystrokes to an iframe from a browser. I am trying desperately to avoid installing anything on the clients machine.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,321
    Rep Power
    25

    Default

    emulate keystrokes
    Why emulate? Can the fields be initialized with the values?
    What role does the person sitting in front of the browser window play? Observer?
    send keystrokes to an iframe from a browser.
    What is an iframe? Where is the iframe relative to the browser?
    And where is the applet in all this?
    Applets are restricted in what they can do. Using the Robot class to send keystrokes probably require permission.
    How would the applet know the userid/password? Wouldn't that be a potential exposure?

  3. #3
    nloding is offline Member
    Join Date
    Aug 2008
    Posts
    2
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    Why emulate? Can the fields be initialized with the values?
    What role does the person sitting in front of the browser window play? Observer?
    I want the person sitting in front of the browser to play absolutely as little as possible. The site I'm loading in the iframe is a 3rd party site that cannot be modified or be initialized with values in the textboxes to start.

    Quote Originally Posted by Norm View Post
    What is an iframe? Where is the iframe relative to the browser?
    And where is the applet in all this?
    Applets are restricted in what they can do. Using the Robot class to send keystrokes probably require permission.
    How would the applet know the userid/password? Wouldn't that be a potential exposure?
    Uh, the iframe is in the browser. It's an XHTML <iframe ...>< /iframe> tag. The applet I hope to run on the main page that the iframe is loaded into (see code at bottom). I know nothing about permissions, or Java at all really, so that's why I'm asking here. Basically I just want it to type into the textboxes in the iframe.

    Potentially exposing the username and password is the least of my worries, for various reasons. I'm just looking at the functionality of this, not the security of it right now. Again, for various reasons; those concerns have already been addressed.

    Sample page idea:
    Java Code:
    <html>
    <head><title>Test</title></head>
    <body>
    <!-- Java applet code here, however that works -->
    
    <iframe src="[forum wouldn't let me post link here]" width="100%" height="75%"></iframe>
    
    </body>
    </html>

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,321
    Rep Power
    25

    Default

    The Robot class has methods to position the cursor on the screen and to "type" characters.
    If you can put the input fields at a certain location on the screen, then it would be possible to use the Robot class to enter data into those fields.
    The applet would have to have permission to be able to do that.
    Permission can be given by signing the applet. The browser would then prompt the user if it was ok to give the applet permission to run. This would require the user to respond.
    See the following for an example: Applet Reader
    Its a signed applet that tries to read a file from your disk.

Similar Threads

  1. how to send SMS using Java API
    By sanjeevtarar in forum Advanced Java
    Replies: 4
    Last Post: 09-13-2009, 03:15 PM
  2. send email using JMS
    By Heather in forum Advanced Java
    Replies: 9
    Last Post: 01-07-2009, 03:04 PM
  3. Saving word document from iframe
    By anil@netedgecomputing.com in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 05-15-2008, 11:49 AM
  4. Showing how to add Actions for KeyStrokes
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 04-23-2008, 08:17 PM
  5. CookieManager doesn't send cookies?
    By Zer0 in forum Networking
    Replies: 0
    Last Post: 02-03-2008, 05:07 PM

Posting Permissions

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