Solved

ColdFusion using Query String parameters

Posted on 2008-06-16
5
590 Views
Last Modified: 2013-12-24
I have attached the instructions for a form I am working on.  I understand how to pass the string for validation,  but what I don't know is how to hide the results from the user and then append the information to another string that the user would see (below):


<cfoutput><a href="http://print.redleafdigital.com/fma/login.aspx?key=#Sesson.Key#">Customized Holiday Cards</a></cfoutput>
SSO.pdf
0
Comment
Question by:Albee_J
5 Comments
 
LVL 82

Expert Comment

by:hielo
ID: 21797891
>> but what I don't know is how to hide the results from the user
Not sure what you are doing, but perhaps you need hidden variables:
<input type="hidden" name="myFieldName" value="#url.theFieldName#"/>
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 21798293
The SSO.pdf is a bit strange because the examples do have typos and use the same string as auth= key and the session key.
From the description I read that the session key is generated for every use as a new key and valid only for one ´session authentication. Therefore there is no need to hide the Session key.
Big care is to keep the auth= key secret but that auth key handling has NOT to go to browser. It has to be handled completely on ColdFusion side.
0
 

Author Comment

by:Albee_J
ID: 21803610
Thanks for the information Zvonko:

What I am stuck on is how to grab the returned auth key and store it as a session variable that can be used to redirect the user.

See my code below. (note I have hidden our key information etc)


<!---Digital Storefront Code--->
 
<cfif IsDefined('Sesson.AuthKey')>
<cflocation addtoken="no" url="http://print.redleafdigital.com/***/login.aspx?key=#Sesson.AuthKey#">
<cfelse>
 
<dd class="bodytext"><img src="../SiteImages/new.gif" alt="New" width="37" height="24" hspace="2"><cfoutput><a href="http://print.redleafdigital.com/***/SSO.aspx?user=#Session.SuNameKey#&company=**auth=****-****-**-****-****">Customized Holiday Cards</a></dd>
</cfoutput>
 
</cfif>
 
<!---End Digital Storefront Code--->

Open in new window

0
 
LVL 2

Accepted Solution

by:
adobe116 earned 500 total points
ID: 21817261
Hi, I'm not sure I understand exactly what you need to do because I don't understand where the session var comes into play, but I think you need to use the cfhttp tag.

On the page where the user is logging in, call the cfhttp tag and return the result to the user.  Store it as a session to if needed.

You would do something like:
<cfhttp method="Get"
    url="http://print.redleafdigital.com/acme/SSO.aspx?user=user@domain.com&company=3aut
h=14363E23-67E9-41E9-9AE4-CC8B01F4EB70"
    name="returnedTempAuthKey">
<cfdump var="#returnedTempAuthKey#"><br>

#returnedTempAuthKey# should be your 36 char temp key.  Once you know it works, comment out the CFDUMP line.  

Then you could do (further down the page):
<form name="store" method="POST"
action="http://print.redleafdigital.com/acme/login.aspx">
<input type="hidden" name="key" value="#returnedTempAuthKey#">
<a href="#" onClick="Javascript: document.store.submit();">Click Here to view
your storefront</a>
</form>

I'll attach this as a code snippet below.  I used the form example from page 2 of your pdf, you can just substitute the <a> example as well.  Best of luck.
<!--- GET TEMP KEY FROM REDLEAF --->
<cfhttp 
    method="Get"
    url="http://print.redleafdigital.com/acme/SSO.aspx?user=user@domain.com&company=3aut
h=14363E23-67E9-41E9-9AE4-CC8B01F4EB70"
    name="returnedTempAuthKey">
 
<!--- DUMP THE RESULTS FOR TESTING --->
<cfdump var="#returnedTempAuthKey#"><br>
 
<!--- FORM FOR USER (From page 2 of your pdf) --->
<form name="store" method="POST"
action="http://print.redleafdigital.com/acme/login.aspx">
<input type="hidden" name="key" value="#returnedTempAuthKey#">
<a href="#" onClick="Javascript: document.store.submit();">Click Here to view your storefront</a>
</form>

Open in new window

0
 

Author Closing Comment

by:Albee_J
ID: 31467787
Excellent, Thank you!
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
The purpose of this video is to demonstrate how to insert an Iframe into WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Open Page or Post…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question