|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Authentication (setcredentials with flash)
by Immovfp
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Hi ,
I want to put a authentication on my Flash remoting with fluorine. But i don't find the code to do this. I create a class c# public override IPrincipal DoAuthentication(string username, System.Collections.Hashtable credentials) { string password = credentials["password"].ToString(); if (username == "admin" && password == "admin") { string[] appRoles = { "admin", "privilegeduser" }; GenericIdentity identity = new GenericIdentity(username); GenericPrincipal principal = new GenericPrincipal(identity, appRoles); return principal; } return null; } On the side Flash, i have an error : this.service = new Service("http://localhost/fluorineService/gateway.aspx",null,"fluorineService.Flash.Diaporama",null,null); this.service.connection.setCredentials("admin", "admin"); LoginCommand not found. Security information for the current request was not available Have you an idea ? Do i modify the web.config ? Thank's olivier ps : i create in global.asax : void Application_AuthenticateRequest(object sender,EventArgs e) { if ( HttpContext.Current.User != null) { if (HttpContext.Current.User.Identity.IsAuthenticated) { if (HttpContext.Current.User.Identity is System.Web.Security.FormsIdentity) { FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity; FormsAuthenticationTicket ticket = id.Ticket; //Get the stored user-data, in this case, our roles string userData = ticket.UserData; string[] roles = userData.Split(','); HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(id,roles); } } } } Nothing , i have always an error. i download the code authentication the blog 3alves in vb , but it's doesn't work . _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
|
|
Re: Authentication (setcredentials with flash)
by Support-179
::
Rate this Message:
Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message Answer here:
http://forum.fluorinefx.com/viewtopic.php?f=5&t=76#p223 PS: You do not need global.asax (or that code in global.asax) if you do not plan to have authentication from asp.net webforms too. -----Original Message----- From: fluorine-bounces@... [mailto:fluorine-bounces@...] On Behalf Of Immovfp Sent: Wednesday, April 09, 2008 12:13 PM To: fluorine@... Subject: [Fluorine] Authentication (setcredentials with flash) Hi , I want to put a authentication on my Flash remoting with fluorine. But i don't find the code to do this. I create a class c# public override IPrincipal DoAuthentication(string username, System.Collections.Hashtable credentials) { string password = credentials["password"].ToString(); if (username == "admin" && password == "admin") { string[] appRoles = { "admin", "privilegeduser" }; GenericIdentity identity = new GenericIdentity(username); GenericPrincipal principal = new GenericPrincipal(identity, appRoles); return principal; } return null; } On the side Flash, i have an error : this.service = new Service("http://localhost/fluorineService/gateway.aspx",null,"fluorineServic e.Flash.Diaporama",null,null); this.service.connection.setCredentials("admin", "admin"); LoginCommand not found. Security information for the current request was not available Have you an idea ? Do i modify the web.config ? Thank's olivier ps : i create in global.asax : void Application_AuthenticateRequest(object sender,EventArgs e) { if ( HttpContext.Current.User != null) { if (HttpContext.Current.User.Identity.IsAuthenticated) { if (HttpContext.Current.User.Identity is System.Web.Security.FormsIdentity) { FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity; FormsAuthenticationTicket ticket = id.Ticket; //Get the stored user-data, in this case, our roles string userData = ticket.UserData; string[] roles = userData.Split(','); HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(id,roles); } } } } Nothing , i have always an error. i download the code authentication the blog 3alves in vb , but it's doesn't work . _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesil entgroup.com -- No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.10/1367 - Release Date: 4/9/2008 7:10 AM _______________________________________________ fluorine mailing list fluorine@... http://fluorine.thesilentgroup.com/mailman/listinfo/fluorine_fluorine.thesilentgroup.com |
| Free Forum Powered by Nabble | Forum Help |