By venu on Jan 02, 2008
Before you begin follow these two common steps.
- Download latest stable sailfin build from here.
- Install Netbeans 6.0 with SIP plugin. You will find this installation document useful.
In this entry I will share on how to enable SIP Digest Authentication for SIP Servlet Application and authenticate using a SIP Client(We have tried Twinkle available with Ubuntu and X-Lite)
Create a new SIP Project in Netbeans as shown in Fig1.
Step 2 : Create a new Sip Servlet as shown in Figure 2
Step 3 : Netbeans generates the SIP servlet with empty methods, I changed it to look like what is seen in figure 3.
Step 4 : Now that we have created the servlet, we will now proceed to configure the application server.
To do this Start the application server and database using following commands
asadmin start-domain domain1
To start database
Step 5 Login into Admin console( http://localhost:4848 ) and create JDBC resource as shown in Figure 5
Step 6 : Now that we have created the JDBC resource we can now go ahead and create JDBC Digest Realm using the Admin console (shown in Figure 6)
Step 7 : Next step is to setup the backend . Connect to the database using Netbeans as shown in Figure 7 and run the following sql script.
Step 8 : Now that we have configured both the backend and the application server it is time to enable security in the SIP Servlet application.Create sip.xml and sun.xml as shown in Figure 8 and Figure 9. The security constraint in sip.xml shows that REGISTER methods should be authenticated and only users with manager role should be allowed to register.
Step 10 : Once the application is deployed run the SIP Client(In this case I used twinkle) . When the client tries to register user will be requested to enter authentication information as shown in Figure 10 and Figure 11 shows logs in Application server once the user is authenticated and authorized.
Figure : 11
Powered by ScribeFire.