David,

I think Erin's solution is better than my little HTML hack. Hers checks if there is a connection before logging in, but this doesn't need Ruby to run, so for the sake of an alternative:

Copy the text into a file and rename it "login.html" (it's just a webpage) in your home directory. You must put your route y id and password in the file (they go where the "[NET ID GOES HERE]" and "[PASSWORD GOES HERE]" are - leave the quotes) because they're necessary to authenticate.

You will need to run it in a browser (text-based, since the box is headless) that supports ssl, which is where Michael's suggestion of elinks comes in (though I have no experience with it). Looking at the docs for elinks, ( http://elinks.or.cz/documentation/manpages/elinks.1.html ):

[EMAIL PROTECTED]:~> elinks /home/dallred/login.html

should open elinks and load that file. Putting that same line in cron will do that on a schedule, like Erin's solution.

Now for the disclaimer: Your mileage may vary. I tested this on the campus wireless system and it worked. It works because the authentication script does not check where the user id and password originate (it doesn't know the difference between one coming from the official BYU login page and the one coming from a page on your box). This is not a very secure design, especially for everything someone could do with your login and password, and I would hope they would fix it at some time. If they do, this will not work. At that point, getting into Perl (which all *nixers should at some point) and WWW::Mechanize, like Sasha said, would be a good idea.

Finally, David, we're here to help, and I think you've already demonstrated a patient attitude. Let us know if it doesn't work.

-jb





David Allred wrote:

How would I run this script?
I can ssh (if the local is up..)

but would prefer to cron it..
IF I can put the script in a cron, could I have the cron check say every hour and run the script if the network is down

On Dec 2, 2005, at 5:29 PM, jb wrote:

I once knew a certain person who hated Kronos, and was always at work on time. (Not me, I'm on contract.) So, since Krono doesn't check referrers on form submissions, he wrote a JavaScript page that used iframes with onloads to create a new session, log him in, and then punch in/out for him. He put in cron to run "mozilla /home/ johndoe/punch.html" when he wanted to be in/out.

Every time card of his was 20 hours/week right on the dot.

That person's morality aside. A similar solution could work here. In fact, I just tested it here in the McKay, and the I was able to authenticate a new MAC by hardcoding my net ID and password into this script page:

<html><body>
<form method="post" action="https://connect6.app.byu.edu/auth/ perfigo_validate.jsp"> <input type="hidden" name="reqFrom" value="perfigo_simple_login.jsp" />
     <input type="hidden" name="uri" value="http://www.byu.edu/"; />
     <input type="hidden" name="cm" value="dosntmatter" />
     <input type="hidden" name="userip" value="" />

     <input type="hidden" name="os" value="WINDOWS_XP" />
     <input type="hidden" name="index" value="4" />

<input type="text" name="username" size="15" value="[NET ID GOES HERE]"/> <input type="password" name="password" size="16" value="[PASSWORD GOES HERE]"/>
         <input type="hidden" name="provider" value="byu-ldap" />
         <input type="submit" name="login_submit">
   </form>
<script language="javascript">
document.forms[0].submit();
</script>
</body>
</html>

-jb

Michael Moore wrote:


--------------------
BYU Unix Users Group http://uug.byu.edu/
The opinions expressed in this message are the responsibility of their
author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list



--------------------
BYU Unix Users Group http://uug.byu.edu/
The opinions expressed in this message are the responsibility of their
author. They are not endorsed by BYU, the BYU CS Department or BYU-UUG. ___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to