T
Tim Mackey
hi,
i'm using a simple web service authentication method (not WSE). the problem
is that when i set a generic principal on the Context.User object, it is
lost by the time the next call is made by the client on the same web service
object.
the winforms client first calls the login method, which does the following
if the username/pwd is correct:
GenericIdentity id = new GenericIdentity(username, "CustomAuth");
Context.User = new GenericPrincipal(id, new string[]{"MyAppClients"});
then for every other method called in the web service, i call the following
method to make sure that the client has already logged in:
private bool authenticate()
{
if(Context.User.IsInRole("MyAppClients"))
return true;
else
return false;
}
i debugged the code and the Context.User is correctly set at the end of the
login method, but is always reset for subsequent calls. why does this
happen? i thought the web service session would preserve any changes i made
to the Context.user.
thanks for any help
tim mackey.
i'm using a simple web service authentication method (not WSE). the problem
is that when i set a generic principal on the Context.User object, it is
lost by the time the next call is made by the client on the same web service
object.
the winforms client first calls the login method, which does the following
if the username/pwd is correct:
GenericIdentity id = new GenericIdentity(username, "CustomAuth");
Context.User = new GenericPrincipal(id, new string[]{"MyAppClients"});
then for every other method called in the web service, i call the following
method to make sure that the client has already logged in:
private bool authenticate()
{
if(Context.User.IsInRole("MyAppClients"))
return true;
else
return false;
}
i debugged the code and the Context.User is correctly set at the end of the
login method, but is always reset for subsequent calls. why does this
happen? i thought the web service session would preserve any changes i made
to the Context.user.
thanks for any help
tim mackey.