Exemple #1
0
        public static void DoLogin()
        {
            UserPassCredential credential = new UserPassCredential();

            credential.userName = "******";
            credential.password = "******";

            AuthenticationServiceClient client = new AuthenticationServiceClient();

            try
            {
                ContextInformationInspector behavior = new ContextInformationInspector();
                client.Endpoint.Behaviors.Add((IEndpointBehavior)behavior);

                AuthenticatedToken token = client.LogInUserPass(credential);
                TokenManager.Instance.LoadToken(token);
                client.Close();
            }
            catch (Exception ex)
            {
                client.Abort();
            }
        }