Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 7th, 2008, 10:07 AM
Authorized User
 
Join Date: Jan 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help passing login info to new page

Hello, I'm trying to set up our login page so that when they login, they can click a link to a third-party website, which will automatically log them in using login info from our database.

ANY advice or pointers would be great.

Thanks.

Peter Hansen
Software Developer
AtHomeNet, Inc.
peterh@athomenet.com
__________________
Peter Hansen
Software Developer
AtHomeNet, Inc.
peterh@athomenet.com
 
Old January 7th, 2008, 10:37 AM
Authorized User
 
Join Date: Jan 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Need help.
=[

Peter Hansen
Software Developer
AtHomeNet, Inc.
peterh@athomenet.com
 
Old January 7th, 2008, 12:09 PM
Authorized User
 
Join Date: Jan 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Figured it out.

Peter Hansen
Software Developer
AtHomeNet, Inc.
peterh@athomenet.com
 
Old January 7th, 2008, 06:33 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Your solution may be useful to others...

Wind is your friend
Matt
 
Old January 10th, 2008, 12:39 PM
Authorized User
 
Join Date: Jan 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, it turns out that the vendor wanted to simply pass the login info in the querystring, figuring it's safe enough since you need to be logged in prior anyway.

When a user logs in, all their user info is stored into session, and on the next page after a successful login(inside_home.asp), there is a link calling a javascript function to post to the vendor.
i.e.
Code:
<a href='http://www.securedata-trans5.com/ap/ap_admin_v2/admin_v2.php' onClick='JavaScript:AppointmentPlusLogin();return false;' target=_top>blah blah</a>
the javascript function is simply
Code:
function AppointmentPlusLogin() {
window.location.href = document.form1.submit();
VBScript
Code:
<%          
        Set dc = Server.CreateObject("ADODB.Connection")
        dc.ConnectionTimeout = Session("dc_ConnectionTimeout")
        dc.CommandTimeout = Session("dc_CommandTimeout")
        dc.Open Session("dc_ConnectionString"), Session("dc_RuntimeUserName"), Session("dc_RuntimePassword")
        Set cmdTemp = Server.CreateObject("ADODB.Command")
        Set dcUser = Server.CreateObject("ADODB.Recordset")
        cmdTemp.CommandText = "SELECT * FROM login LEFT JOIN person ON login.login_id = person.login_id WHERE (person.person_id = " & Session("person_id") & ") AND person.hide_record <> 1"
        cmdTemp.CommandType = 1
        Set cmdTemp.ActiveConnection = dc
        dcUser.Open cmdTemp, , 0, 1

        dim pw
        pw = dcUser("last_name")

        dim pw2
        pw2 = trim(left(pw,3))

            dcUser.Close
            Set cmdTemp = Nothing
            Set dcUser = Nothing
            dc.Close
            Set dc = Nothing


%>
And here's the form telling the javascript function AppointmentPlusLogin what to do.
Code:
<form name="form1" id="form1" method="post" action="http://www.vendor.com/admin_v2.php?action=log_in&login=<%= pw %>&password=<%= pw2 & Session("login_name") %>">

</form>
Please note that I don't recommend passing login info through the querystring if it can be avoided.

Peter Hansen
Software Developer
AtHomeNet, Inc.
peterh@athomenet.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing session variables from login page. captainzorro Classic ASP Components 1 April 23rd, 2008 11:54 PM
Grabbing user login info Quick209 ASP.NET 2.0 Basics 1 May 12th, 2006 07:06 PM
Passing CR Login info in a ASP.NET app. billbeecher@cox.net BOOK: Professional Crystal Reports for VS.NET 0 March 31st, 2005 10:23 PM
Passing NT Login Info negrette Classic ASP Professional 1 October 25th, 2004 02:37 PM
Passing logon info sandeep Crystal Reports 1 October 6th, 2004 08:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.