Introduction
When he came out. NET Framework 2.0, one of the innovations he brought with him was the possibility of using a series of controls and classes for managing users, profiles and roles, with typical features of an application with user management. For
up there all right, but this was available only for Web applications, you could not use Windows, so this kind of applications we had to do extra work to manage users. Now
output. NET Framework 3.5, it will soften things, not that we have the same controls available to do this, but here we can centralize the management of users, which is known as Client Application Services.
What is Client Application Services?
is a concept designed to integrate applications Windows Forms client services Membership of ASP. NET, ie we have a service where users are administered from a Winforms application can reference it and we can authenticate users and all classes of membership that we can afford. Practical Example
For all this issue is clear, here I'll explain how to implement it.
If you want to know how this works management of users and profiles, I invite you to review these articles published some years ago: Customizing
These items were for version 2.0 asp. Net, but they are also valid work with in VS 2008.
Back then, we will start with the sample application.
1. Creating the database
This database will serve to store users, this is done with a utility that comes with it. NET Framework, you have to do is go to Start-> All Programs- > Microsoft Visual Studio 2008 -> Visual Studio Tools and open the Command Prompt, will open a DOS console where asp_regsql write, I see a wizard to create a database automatically, you just have to give up next where we ask for data from the server and database, we can let you create the database with the name by default or we can assign any name as shown in the picture.
Once entered the data, we next and finish with this we have our database ready for use in our example application.
2. Creation of the
Now create the service that will connect to the database and interacts with the application to manage users, this will create a new project of type ASP. NET Web Service Application.
This creates a service template, which will not use, because the Windows application will connect directly.
3. Roles and User Configuration
now configure our users and roles that have access to our application, it will use the ASP. NET Configuration Tool can locate it in the menu Project-> ASP. NET Configuration found at the end of menu. We will
a sale of a browser that will allow us to configure everything, this is either intuitive so I will summarize, you should go to the Security tab and go to the link that says Use the Wizard to configure security settings step safety step. in selected access method from the Internet, roles are enabled for the application, add 02 roles (Manager, Customer), we created 02 users also do not add any access rule and the end returns to the safety, here we go to manage users-> edit functions and a user assigned to the Role Administrator role and the other customers and close the browser.
4. Enabling Client Application Services
To make this service can respond to applications that communicate with the need to add the following code to the Web.config file
\u0026lt; system.web.extensions >
\u0026lt; scripting >
\u0026lt; webServices >
\u0026lt; authenticationService enabled = "true" requireSSL = "false" />
\u0026lt; RoleService enabled = "true" />
\u0026lt;/ webServices >
\u0026lt;/ scripting >
\u0026lt;/ system.web.extensions >
We read in the next inning.
0 comments:
Post a Comment