I am working on a single sign on sollution for two different websites.
I am trying to make the methods in my customized(overriden) provider post to a web service and get the results from it so that the same login.
It works for most methods but there are ones that return System.We.Security sp3ecific objects that fail. For example
Expand|Select|Wrap|Line Numbers
- public override MembershipUser GetUser(object providerUserKey, bool userIsOnline)
- {
- System.Web.Security.MembershipUser mu = null;
- iConnect.Core.iConnectWS.iConnect connect = new iConnect.Core.iConnectWS.iConnect();
- mu = ((MembershipUser)connect.GetUser(providerUserKey, userIsOnline));
- return mu;
- }
and it calls
Expand|Select|Wrap|Line Numbers
- [WebMethod(EnableSession = true)]
- public object GetUser(object providerUserKey, bool userIsOnline)
- {
- return (object) System.Web.Security.Membership.GetUser(providerUserKey, userIsOnline);
- }
(the webservice uses the default asp.net provider System.Web.Security.SqlMembershipProvider)
My problem is that when I try to run this I get an error
Expand|Select|Wrap|Line Numbers
- Unable to cast object of type 'iConnect.Core.iConnectWS.MembershipUser' to type 'System.Web.Security.MembershipUser'
The class is the web service and the one in the one in the provider is one and the same System.Web.Security.MembershipUser.
Can anyone help me?
thank you in advance