Login to the WebService
- From: "Mike Endys" <MikeEndy@xxxxxxxxxxxxx>
- Date: Fri, 31 Oct 2008 11:53:57 +0100
Hi all,
have problem to use login to the web service. Im thinking about the web service that provides datas and files to the WinForm Client. I want the client log-in to the application... here is my not-working solution
this is my web service, with the Forms authentication and working on AspSqlMembershipProvider and with Role provider implemented too. It is working well. I can create user, I can ValidateUser... But I would like, that I once ValidateUser, then it will be validated and authenticated whole time the Client application is opened. So I will able to call
TrySecured() Method. What is the best practice, to do it?
In a few points:
1. Client App is a WinForm client
2. Must provide Creating new user -> AspSqlMembershipProvider
3. Must provide only once SignUp to the aplication over web service via AspSqlMembershipProvider
4. Some methods will be available only for authenticated users, or access to the methods will be managed via Membership roles.
public class UserAccountService : System.Web.Services.WebService
{
[WebMethod]
public bool Login(string userName, string password)
{
bool retVal = Membership.ValidateUser(userName, password);
return retVal;
}
[WebMethod]
public string GetCurrentUser()
{
MembershipUser mUser = Membership.GetUser();
return mUser.UserName;
}
[WebMethod]
[PrincipalPermission(SecurityAction.Demand, Authenticated = true)]
public string TrySecured()
{
return "Secured call successful";
}
}
Thanks a lot for any ideas.
Mike
.
- Prev by Date: Re: Microsoft Webservice Security Problem
- Next by Date: Nested Custom Class as input parameter in web method
- Previous by thread: WCF and ASP.Net wsHTTPBinding Access Denied
- Next by thread: Nested Custom Class as input parameter in web method
- Index(es):
Relevant Pages
|
Loading