The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> Flash Help
|
Flash Player 10 - Login to 3rd party site (was Iframe Passthrame)
Discuss Login to 3rd party site (was Iframe Passthrame) in the Flash Help forum on Dev Shed. Login to 3rd party site (was Iframe Passthrame) Flash Help forum discussing all products originally created by Macromedia including DreamWeaver, Contribute, Flash, Fireworks, Freehand, Director, Authorware and HomeSite. Adobe bought Macromedia in 2005.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

October 11th, 2011, 03:47 AM
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 3
Time spent in forums: 37 m 11 sec
Reputation Power: 0
|
|
|
Flash Player 10 - Login to 3rd party site (was Iframe Passthrame)
I would appreaciate if you could give me a hand in this javascript in the codebehind of a C# asp.net page. What I want to do is have a button, which when pressed will do the following:
1. create a frame or iframe or something like that
2. go to page within that frame
3. login to that page by focusing on specific form elements and then submiting the form
4. Redirect to that logged in page
Here is what I have managed until now:
Code:
<iframe id="logonframe" src="https://.com" style="width: 100%; height: 200px; border:none;"></iframe>
<script language=Javascript>
function paybutton()
{
document.domain = "https://.com";
var oIframe = document.getElementById("logonframe");
var oDoc = oIframe.contentWindow || oIframe.contentDocument;
if (oDoc.document) {
oDoc = oDoc.document;
}
oDoc.getElementById("logonButton").click();
oDoc.parent.login.logonForm.f_username.value = 'xxxl@quer.co.uk';
oDoc.parent.login.logonForm.f_passwd.value = 'zzz';
oDoc.parent.login.logonForm.submit();
return true;
}
</script>
<input type="button" value="my javascript" onclick="javascript:paybutton()" style="float:left;" />
|

October 11th, 2011, 07:26 AM
|
 |
Lost in code
|
|
|
|
|
Browsers won't allow you to manipulate the contents of a frame unless it is on the same domain as the parent page.
|

October 11th, 2011, 07:38 AM
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 3
Time spent in forums: 37 m 11 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by E-Oreo Browsers won't allow you to manipulate the contents of a frame unless it is on the same domain as the parent page. |
Thanks for your reply. Can you suggest any other way of doing what I need to do?
|

October 11th, 2011, 08:01 AM
|
 |
Lost in code
|
|
|
|
|
Using asp.net/JavaScript there is no way for you to log in the user on a third party site. You would need to be able to execute privileged code, like signed Java, Flash or a browser extension to be able to do something like that.
If you have some control over the third party site then you could program an API that would allow you to do this.
If the site has a "GET" form that allows the user to log in then you could use that instead. If you set the iframe URL directly to that then you'll log them in immediately.
|

October 11th, 2011, 08:56 AM
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 3
Time spent in forums: 37 m 11 sec
Reputation Power: 0
|
|
Thanks, can you give me any advice on how to go about realising this in Flash? Will it be just a actionscript running in the background through an embedded swf video module - which would be the button?
Quote: | Originally Posted by E-Oreo Using asp.net/JavaScript there is no way for you to log in the user on a third party site. You would need to be able to execute privileged code, like signed Java, Flash or a browser extension to be able to do something like that.
If you have some control over the third party site then you could program an API that would allow you to do this.
If the site has a "GET" form that allows the user to log in then you could use that instead. If you set the iframe URL directly to that then you'll log them in immediately. |
|

October 11th, 2011, 05:06 PM
|
 |
Lost in code
|
|
|
|
|
I really have no idea, I've never programmed anything in Flash. I asked a moderator to move your thread to the Flash board.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|