Login to the WebService



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

.



Relevant Pages

  • Re: a web service to log in to a image application server
    ... I don't know how it would be handled client side using PHP. ... You could also reuse a known authentication scheme. ... The image server is used to stored image documents requiring ... If I develop a web service to authenticate log in to ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • RE: Login to the WebService
    ... \par Hi Mike, ... As for forms authentication, I'd like to confirm the following things: ... \par have problem to use login to the web service. ... \par service that provides datas and files to the WinForm Client. ...
    (microsoft.public.dotnet.framework.webservices)
  • WSE 2.0 error: Requested registry access is not allowed
    ... authentication. ... either for web service and client. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Implementing a common SOAP Header across multiple Web Service Pages
    ... to set a client up to reference multiple Web ... the Web Service site would ... Your point about leaving the ASMX page as lean as possible and acting just ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Implementing a common SOAP Header across multiple Web Service Pages
    ... between my Web Service application and the client. ... public string SID; ... Web Service page, rather than to a dozen or so separate Web Service pages ... You can easily create a .ASMX file ...
    (microsoft.public.dotnet.framework.webservices)

Loading