.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
satyapriyanayak
Sambanthamoorthy
Post New Web Links

How can I resolve issues implementing Logout with WPF and Client Application Services?

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :WPF
 

I have recently been prototyping an application using WPF and Client Application Services.  I am trying to use all three features of the Client Application Services : Forms Authenticiation, Role Security, and Client Profile.  I have managed to get everything working, but I feel like my solution is a kludge and want a better way.

For the discussion assume the following:

I have two WPF windows:

The first window is my main Application form.  It has two buttons "Login" and "Check Thread Principal"

The second window is a login form which implements the IClientFormsAuthenticationCredentialsProvider interface to use the GetCredentials method to return a new ClientFormsAuthenticationCredentials object with the entered username and password.

The application starts, the Main Window is loaded and the user clicks the login button.  In the button click event, a call is made to System.Web.Security.Membership.ValidateUser(String.Empty, String.Empty).  This causes the GetCredentials method in my login form to be called which in turns shows the login window.  The code in the button click event of the main window waits until the user enters information in the login window.

Once the user submits the login information, the login form closes, the flow of execution is returned to the main window login cl


View Complete Post


More Related Resource Links

WCF Membership Authentication and Winform Client Application Services

  
I am needing more validation of what I am doing versus solving a problem. I have a winforms application that uses Client Application Services to validate a user against a customer membership provider all over SSL.  This works fine.  My winforms application validates correctly. The winforms application uses WCF to call services that are installed on the same IIS server that is providing the membership services for the Client Application Services.  The WCF services use wsHTTP binding, transport security, username credentials, and validate against the same membership provider as the Client Application Services. It appears that although the service and Client Application Services are at the same URL, they do not share credentials between them.  Ideally, once I log into Client Application Services, any calls to a WCF service at that location would be automatically authenticated.  However, this is not true.  I have to pass the username and password into the credentials for the WCF service.  This works as expected where the username and password are validated prior to allowing a service call.  On subsequent services calls, it does not validate again since it has established the secure channel. So, does this sound like the best approach?  Is there a way to pass credentials from the Client Application Services to WCF automatically?  I

Client Application Services - Role service cache time out bug

  
Hi All, For people using Client Application Services with WPF, be aware of this bug. You can configure the "cache time out" for roles to be fetched again from the service. (In the visual studio dialog, Properties -> Services -> Advanced) This means the roles are cached on the client (in a file). If the application asks for roles again, they are not fetched again for "cache time out" time. When you set this value, it goes into your App.config, transformed into seconds. So if you choose 1 minute, the App.config has: cacheTimeout="60".   However, when using the ClientRoleProvider (for instance to do something like clientRoleProvider.GetRolesForUser("SomeUser")), this cacheTimeOut is interpreted in Minutes, not seconds! To prove my point, check ClientRoleProvider.Initialize method:   string temp = config["cacheTimeout"]; if (!string.IsNullOrEmpty(temp)) _CacheTimeout = int.Parse(temp, CultureInfo.InvariantCulture);   Later on, in ClientRoleProvider.GetRolesFromDBUser (what's in a name?), you see: _CacheExpiryDate = cd.RolesCachedDateUtc.AddMinutes(_CacheTimeout);   Testing also shows this behavior. So be aware, and always put the value in minutes in your App.Config!   Regards, Koen

Client Application Services and Man-in-the-Middle

  
Backgorund: I am using Client Application Services with a WPF client. The client talks to a Forms authenticated web site. I am using the Forms token to protect web services that the client uses to get information from the web site. I am protecting the web services with certificates, both server and client. Issue: All the web services are protected against man-in-the-middle attacks. The test I am using is to load Fiddler on the client and allow it to install certificates. The presence of fiddler as man-in-the-middle is detected by all the web services but not by the validation request of Client Application Services. I am able to read the user name and password from that message using Fiddler. How can I get client application services to use the certificates?

Client Application Services

  

I'm developing a Client Application using the Smart Client Software Factory; I've created a login form that implements the IClientFormsAuthenticationCredentialsProvider interface, I've also configured enabled the 'Client Application Services' on the project which is the main entry point.

The login form is displayed, and I supply login details yet the application can't authenticate?

I've place the same code in a simple (one project) winform application and pointed and all works?

has anyone see this behaviour before; it's driving me crazy

 

 


Authentication and ASPXAUTH size when using Client Application Services; MemberShip.ValidateUser alw

  

Apologies if this is the incorrect forum. Please let me know if it should have been posted elsewhere. Please let me know if I need to clarify anthing. Thanks in advance for any suggestions, direction pointing, etc.
-----
I have been using all three features of  client application services (authentication, profiles, and roles) in my windows app (DotNet 3.5 framework) for almost two years now. Up until now, I have not had any problems. This week I hit a brick wall and am pretty stumped with two seperate but related issues.

Issues:
In development, we decided to upgrade our websites/services to DotNet 4.0. All applications upgraded successfully. However we are unable to log into our application using Client Application services. No matter what user we use, Membership.ValidateUser returns false. Since we know the username and passwords, we thought this was strange. When debugging the application, we found that Membership.ValidateUser was throwing an InvalidOperationException (see below for complete exception) stating that the ASPXAUTH property was too long, longer that the schema created in the SQL/CE database. (See below for things tried).

In production .. A user all of the sudden could no longer gain access to the application. Upon inspection, his ASPXAUTH cookie was 264 characters long (9 characters longer than the schemas nvarchar(256)). E

Lessons Learned: Optimizing A Large Scale Software + Services Application

  

Udi Dahan explains how his team identified and overcame unforeseen problems while developing a large-scale software + services trading application.

Udi Dahan

MSDN Magazine April 2009


PIAB And WCF: Integrating the Policy Injection Application Block with WCF Services

  

Using the PIAB you can enhance WCF services with policies such as validation, performance monitoring, authorization and caching without having to change a line of code.

Hugh Ang and David San Filippo

MSDN Magazine February 2008


Reporting: Deliver User-Friendly Reports from Your Application with SQL Server Reporting Services

  

SQL Server 2000 Reporting Services--a server-based reporting platform built on the .NET Framework and integrated with SQL Server 2000--lets you easily add reporting from diverse data sources. Using Visual Studio and Reporting Services you can integrate reports from any data source that has an OLE DB, ODBC, or ADO.NET provider into your Web applications. This article explains how it's done.

John C. Hancock

MSDN Magazine August 2004


Web Services: Capturing and Analyzing Client Transaction Metrics for .NET-Based Web Services

  

This article presents a general-purpose client quality reporting mechanism that can be used in any .NET-based transaction system that employs HTTP/SOAP. The design uses client response time and quality recording, upload of logs as SOAP headers attached to new transaction requests, and server handoff of these headers to a low priority queue for logging and analysis. This technique gives an enterprise near real-time information on actual end-user response times. These response times reflect network delays, client application overhead and server delays. By using this technique, enterprises can avoid the need to develop custom software to mine HTTP logs.

Brian Connolly

MSDN Magazine July 2004


Stress Testing: Custom LoadGenerator Tool Identifies the Issues Your Application Faces Under Stress

  

It's easy to postpone stress testing when developing an application, and it's easy to forgo it altogether. Having an easy-to-use framework at your fingertips to conduct these tests can make the task far less painful. This article walks you through an application that eases the task of generating load for a variety of layers within an application.

Brian Otto

MSDN Magazine April 2004


.NET CLR Profiling Services: Track Your Managed Components to Boost Application Performance

  

The Microsoft .NET platform provides you with a rich set of services for building profilers and application monitors for applications targeting the Common Language Runtime (CLR). These services expose runtime events that occur during the execution of a .NET application. They can be used to obtain information about managed code being executed under the runtime. This article describes the .NET CLR Profiling Services and shows how to use the services to build a simple profiler that will provide hot spot information for any .NET application. The sample profiler can easily be modified to suit other profiling and monitoring needs.

Anastasios Kasiolas

MSDN Magazine November 2001


C# and the Web: Writing a Web Client Application with Managed Code in the Microsoft .NET Framework

  

When the author wanted to build a middleware Web client to connect to other applications over the Internet, he realized that the XMLHttpRequest COM object was not sufficient for his purposes. In order to build a Web client using managed code, the author had to use the HTTPWebRequest and HTTPWebResponse classes provided by the Microsoft .NET framework. These classes are used in the sample project as a substitute for the less powerful XMLHttpRequest COM object, allowing the author to build a full-featured Web client. They also take advantage of all the benefits that the CLR and managed code have to offer.

Avi Ben-Menahem

MSDN Magazine September 2001


Web Security: Part 2: Introducing the Web Application Manager, Client Authentication Options, and Pr

  

This article, the second of two parts, continues coverage of Web security for Windows. It introduces the Web Application Manager in IIS that allows Web processes to be isolated, decreasing the security risk associated with running in a logon session. The article then picks up where Part One left off-it discusses authentication methods such as basic authentication, digest authentication, integrated Windows authentication, and anonymous logons, and the benefits and drawbacks of each.

Keith Brown

MSDN Magazine July 2000


Looking for a simple Service and Console Client REST sample implementing BASIC authentication

  

Does anyone know of a C# code sample demonstrating WCF REST services and console test client with OperationContracts (GET and POST) implementing mutiple paramaters using BASIC authentication? Also, perhaps, using Fiddler as a test client as well? I have searched high and low for something like this, but have not had any success.


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend