...

View Full Version : Authorization Page Help



SyNNeR6x3
01-21-2009, 12:14 AM
I need to know if there is anything on the web that can "inject" a username and password into the html coding it self.

ie. The content is @ http://123.456.78.9/test.nsv

I want to put a log in box on the site that would inject the user submitted user name and password into the HTML.

Example: User name is: JohnPublic Password is: qwerty123

when the submit button is clicked it will make the turn the html code from:

http://123.456.78.9/test.nsv

to

http://JohnPublic:qwerty123@123.456.78.9/test.nsv

______________________________________________________________

Other info:

I am using the VLC embeded player Mozilla plugin to post video content to the web.

So basically the Embedded player needs the user name and password to authorize the viewing of the content.

This is the coding I am using at the moment and this line:

target="http://username:password@xxx.xx.xxx.x:8000/xxx1.nsv"

is where I need the user submitted info to be injected into.

<html>
<head><title>Embedded</title></head>

<body>

<h1>Demo Embedded Video</h1>
<center>
<embed type="application/x-vlc-plugin"
name="video1"
autoplay="yes" loop="yes" width="800" height="600"
target="http://username:password@xxx.xx.xxx.x:8000/xxx1.nsv" />
<br />
<a href="javascript:;" onclick='document.video1.play()'>Play</a>
<a href="javascript:;" onclick='document.video1.pause()'>Pause</a>
<a href="javascript:;" onclick='document.video1.stop()'>Stop</a>
<a href="javascript:;" onclick='document.video1.fullscreen()'>Fullscreen</a>

</center>



</body>
</html>


Thank you all for your help!! I hope to find some great ideas. :)

Philip M
01-21-2009, 08:32 AM
Here you are:-



User Name <input type = "text" name = "uname" id = "uname"> <br>
Password <input type = "text" name = "passwd" id = "passwd"><br>

<input type = "button" name = "but1" id = "but1" value= "Call Up URL" onclick = "injectIt()">

<script type = "text/javascript">

function injectIt() {
var un = document.getElementById("uname").value;
var pwd = document.getElementById("passwd").value;
var newURL = "http://" + un + ":" + pwd + "@123.456.78.9/test.nsv";
alert (newURL) ; // delete after testing
window.location = newURL;
}

</script>

If the newURL does not exist then you will need to use AJAX to notify the user of the error, otherwise the user will simply receive a 404 error.


Quizmaster: What "R" is Hilary Clinton's middle name?
Contestant: Er, um . .. is it Rottweiler?

SyNNeR6x3
01-21-2009, 05:16 PM
Here you are:-



User Name <input type = "text" name = "uname" id = "uname"> <br>
Password <input type = "text" name = "passwd" id = "passwd"><br>

<input type = "button" name = "but1" id = "but1" value= "Call Up URL" onclick = "injectIt()">

<script type = "text/javascript">

function injectIt() {
var un = document.getElementById("uname").value;
var pwd = document.getElementById("passwd").value;
var newURL = "http://" + un + ":" + pwd + "@123.456.78.9/test.nsv";
alert (newURL) ; // delete after testing
window.location = newURL;
}

</script>

If the newURL does not exist then you will need to use AJAX to notify the user of the error, otherwise the user will simply receive a 404 error.


Quizmaster: What "R" is Hilary Clinton's middle name?
Contestant: Er, um . .. is it Rottweiler?

Okay maybe I am doing something wrong but I put the codes in like you said on an "auth" page and when I put in a username and password it puts them in properly and even goes to the page that it's supposed to. But the embedded video never plays. It seems like the video is not getting the auth.

The site that hosts the video is getting the login details but the embedded video just says it's "loading" meaning that it has no user name and pass to read from... here is the new coding...

This is the auth.html page that I made using the coding you posted.

<html>
<head><title>XME Auth Test</title>


</head>

<body>
<center>
<h1>Please Login Server 1</h1>

<script type = "text/javascript">

function injectIt() {
var un = document.getElementById("uname").value;
var pwd = document.getElementById("passwd").value;
var newURL = "http://" + un + ":" + pwd + "@123.45.678.9:8000/test.nsv";
alert (newURL) ; // delete after testing
window.location = 'http://testing.com/video.html' ;
}

</script>

</center>
<center>
User Name <input type = "text" name = "uname" id = "uname"> <br>
Password <input type = "text" name = "passwd" id = "passwd"><br>

<input type = "button" name = "but1" id = "but1" value= "Call Up URL" onclick = "injectIt()">


</body>
</html>



am I doing something wrong? I get a dialog box telling me the user name and password were applied and it goes to the "target" page just nothing once it gets there...

any ideas are greatly appreciated!!

Thank you for helping me... I can feel like I am really close to getting this to work I just need a few tweaks with all of your help!!

SyNNeR6x3
01-23-2009, 06:19 AM
I still need some help :( Anyone?!?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum