all groups > macromedia flash flash remoting > april 2004 >
You're in the

macromedia flash flash remoting

group:

CFLogin and Flash Remoting Trouble


CFLogin and Flash Remoting Trouble bluestix
4/30/2004 1:17:40 AM
macromedia flash flash remoting:
I can not get my flash form to actually login into a ColdFusion application.
I have used Flash forms before for this purpose and had no trouble.

My form sends the login data and returns the AuthUser and the Roles.
This part works because I have tested it in flash and it returns the proper
results.
When I put the file into a ColdFusion application and test it I cant get it to
actually login.

This form can be tested at:
www.digitalrorschach.com/MembersArea.cfm
Username:Jillian Password:Jillian

Here is my ActionScript:

on(press) {

#include "NetServices.as"
#include "DataGlue.as"
if (inited == null)
{
inited = true;

NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
myconnection = NetServices.createGatewayConnection();
myconnection.setCredentials(_root.User1.text, _root.Password1.text);

myservice = myconnection.getService("Luciddaydreamer", this);
}
myservice.GetAuthUser();
function GetAuthUser_Result(result){
trace(result) // in testing this returns the expected results everytime
_global.Stats = "Web"
}
}
on(release) {
getURL("BravoBlueDreamer.cfm", "_self")
}


Here is my ColdFusion Code in GetAuthUser.cfm:
<cfif GetAuthUser() NEQ "">
<cfset LoggedStatus = ArrayNew(1)>
<cfset LoggedStatus[1] = "#GetAuthUser()#">
<cfset LoggedStatus[2] = #IsUserInRole("Webmaster")#>
<cfset Flash.result = LoggedStatus>
<cfelse>
<cfset Flash.result = "Not Logged In">
</cfif>

Here is the login structure in my Application.cfm:
<cflogin>
<cfif NOT IsDefined("cflogin")>

<cfelse>
<cfif cflogin.name IS "" OR cflogin.password IS "">
<cfoutput>
<p>&nbsp;</p>
<H2>You must enter text in both the User Name and Password fields</H2>
</cfoutput>
<cfinclude template="loginform.cfm">
<cfabort>
<cfelse>
<cfquery name="loginQuery" dataSource="#Request.DSN#">
SELECT UserID, Roles
FROM Login
WHERE
UserID = '#cflogin.name#'
AND Password = '#cflogin.password#'
</cfquery>
<cfif loginQuery.Roles NEQ "">
<cfloginuser name="#cflogin.name#" Password = "#cflogin.password#"
roles="#loginQuery.Roles#">
<cfelse>
<cfoutput>
<H2>Your login information is not valid.<br>
Please Try again</H2>
</cfoutput>
<cfinclude template="loginform.cfm">
<cfabort>
</cfif>
</cfif>
</cfif>
</cflogin>


Like I said I used this exact same file (making the appropriate changes) and
it works fine on another site.

Any thoughts?
Please?

Kelly
Re: CFLogin and Flash Remoting Trouble bluestix
5/6/2004 11:21:07 AM
I figured out a way easier way to do this:

var j_username = _root.Password.text
var j_paswword = _root.UserName.text
Re: CFLogin and Flash Remoting Trouble CF_Admin
5/7/2004 9:11:49 AM
This might be silly of me to ask, but your posted code says:


NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");

Did you change this to the proper URL? Also if your just testing locally, I
think a saw some posts that said to try using 127.0.01:8500 instead of
localhost... just a thought. I know with myself it's usually someting stupid
that I just didn't notice LOL ;)
Re: CFLogin and Flash Remoting Trouble CF_Admin
5/7/2004 9:35:38 AM
Sorry, missed the psrt about it actually returning the data... I cant even get
mine to do that! I started with using CF Application, but striped down to a
simple query in the course of debugging. Maybe you could help me. See my post:

[b]" Not Authorized!?!?!"[/b]

Thanks...

In the mean time maybe pondering your problem will help me (or at least
distract me so I can come back to it). I'll let you know If I figure it out.
Re: CFLogin and Flash Remoting Trouble CF_Admin
5/7/2004 10:18:08 AM
Looks like your site: www.digitalrorschach.com/MembersArea.cfm is down... I
registered and logged in fine, and was greatly enjoying browsing your
content... but now nothing. Are you using Access DB? That cn often crash and
take CF with it.
Re: CFLogin and Flash Remoting Trouble bluestix
5/20/2004 1:40:19 PM
Hi
Glad you like the site.
I am still working on it but the login works fine now.
I just finished a super complex remoting project for someone else too.
I added some new pages to my site if you want to check them out.
They can be seen in the members area

www.digitalrorschach.com
www.dekaydmedia.com

Kelly
Dekayd Media Inc.
kelly@dekaydmedia.com
Re: CFLogin and Flash Remoting Trouble jaded5150
5/20/2004 6:27:44 PM
Question for ya. I'm attempting something similar, but I have my CFLogin
structure in application.cfm so it runs everytime I try to open a CFC service.
Some of the cfcs don't require a valid login, but here's my problem...

<cfif (validateUser.recordcount eq 1) and
(validateUser.password is hash(validateUser.salt & cflogin.password))>
<cfset userRoles = valueList(validateUser.roles)>
<cfloginuser name="#cflogin.name#" password="#cflogin.password#"
roles="#userRoles#">
<cfelse>
<!--- Send something to Flash saying login failed --->
<cfabort>
</cfif>

How do you catch that failure from the application.cfm in flash? It's just an
application.cfm getting ran...should I just move application.cfm into a set CFC
that gets called and then catch the error that way? This would be a nicer way,
but can't figure out how to get the application.cfm to report something to
Flash.
AddThis Social Bookmark Button