Visual Basic.NET
  Home arrow Visual Basic.NET arrow Automating Security with Policies in Web S...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Automating Security with Policies in Web Services
By: MSDN Virtual Labs
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2006-07-27

    Table of Contents:
  • Automating Security with Policies in Web Services
  • Requiring Security Features with a Policy
  • Adding Security Features with a Policy on the Client
  • Adjusting Policy Details (Encrypting a usernameToken)

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Automating Security with Policies in Web Services


    (Page 1 of 4 )

    Last week's exercise taught you how to install a sample X.509 certificate and configure your applications to take advantage of their improved security. This week's exercise gets into policies, which allow for greater automation of certain aspects of security. It is the third in a series of exercises that are part of a lab titled "Web Services Enhancements 2.0: Security and Policy," written by MSDN Virtual Labs.

    Exercise 3 Automating Security with Policies

    Scenario

    In the last two exercises you were able to secure the SecureInvoiceService application by requiring UsernameToken authentication, message signatures, encryption, and implementing authorization checks in your WebMethod code. You also used X.509 certificates for signing and encrypting messages, which provided stronger security in the areas of integrity and privacy.

    Implementing these security features was a manual process, meaning you had to write code to introduce the functionality. This can be tedious and error-prone. A better approach would allow developers to declaratively enable security features, without having to write any code, while relying on the infrastructure take care of the details.

    WS-Policy is a Web services specification that allows Web services to describe policies. A policy describes the requirements, preferences, and capabilities of a service. A policy statement consists of one or more policy assertions (see WS-PolicyAssertions and WS-SecurityPolicy). Developers can read policy statements to learn how to deal with the service appropriately. Infrastructure can programmatically inspect policy statements in order to automate the code you wrote in the previous exercises. WSE 2.0 provides support for all of these specifications as you'll see below. In this exercise, you're going to secure SecureInvoiceService with minimal code.

    You'll be working in the Exercises\C\before directory.

            Tasks              Detailed steps

     

    Getting Started.

    You can write policies for receiving messages as well as for sending messages. In this exercise you're going to write a policy that describes messages received by the Web service. 

    1. Return to Visual Studio .NET 2003.
       
    2. Click File | Open | Project.
    3. Navigate to C:\Microsoft Hands-on-Lab\DEV-HOL34\VB\Exercises\C\before
    4. Select PolicyInvoice.sln and click Open. This solution consists of two projects: PolicyInvoiceClient and PolicyInvoiceService
    5. The code in PolicyInvoiceClient is nearly identical to the SecureInvoiceClient project you started with before adding security features. The only difference is that WSE 2.0 has already been enabled. 
    6. The code for PolicyInvoiceService is identical to the SecureInvoiceService project you started with before adding security features. The only difference is that WSE 2.0 has already been enabled.

      Note: it doesn't currently require any security features, such as security tokens, signatures, or encryption.

    7. Build the solution. Run the client and verify that security is not currently in place.

      Note: now your goal is to provide the same security features you implemented in the previous exercises without writing a single line of code. You'll accomplish this with a policy.

    More Visual Basic.NET Articles
    More By MSDN Virtual Labs


       · We hope you found this exercise from MSDN Virtual Labs to be educational and...
     

    VISUAL BASIC.NET ARTICLES

    - Clocks and Countdowns
    - User-defined Functions using Visual Basic Ap...
    - Understanding Object Binding in VBA
    - Mastering the Message Box
    - Testing a Windows Forms Application
    - Using Visual Basic.NET Features to Code a Wi...
    - Correcting Code in a Windows Forms Applicati...
    - Write Readable Code and Comments for Windows...
    - How to Code and Test a Windows Forms Applica...
    - Adding Features to a Windows Forms Applicati...
    - How to Design a Windows Forms Application
    - LINQ to XML Programming Using Visual Basic.N...
    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek