Unknown macro: {next_previous_links}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

The steps below demonstrate how you can apply security to a proxy service via WSO2 Integration Studio.

Prerequisites

Step 1: Creating a registry resource project

First, create a registry resource project. We will use this project to store the security policy (which is a registry resource).

  1. Open WSO2 Integration Studio and click Miscelleneous → Create New Registry Project in the Getting Started tab as shown below.

  2. Enter a name for the project and click Next.
  3. Enter the Maven information about the project and click Finish.
  4. The new project will be listed in the project explorer.

Step 2: Creating the security policy file

Follow the instructions given below to create a WS-Policy resource in your registry project. This will be your security policy file.

  1. Right-click the registry resource project in the left navigation panel, click New, and then click Registry Resource. This will open the New Registry Resource window.
      
  2. Select the From existing template option as shown below and click Next.
  3. Enter a resource name and select the WS-Policy template along with the preferred registry path.

  4. Click Finish. The policy file is now listed in the project explorer as shown below


  5. Double-click the policy file to open the file. Note that you get a Design View and Source View of the policy.

  6. Let's use the Design View to enable the required security scenario. For example, enable the Sign and Encyrpt security scenario as shown below.

    Click the icon next to the scenario to get details of the scenario.


  7. You can provide also provide encryption properties, signature properties, and advanced rampart configurations as shown below.

Specifying role-based access?

For certain scenarios, you can specify user roles. After you select the scenario, scroll to the right to see the User Roles button.

Either define the user roles inline or retrieve the user roles from the server.

By default, the role names are not case sensitive. If you want to make them case sensitive, add the following property under the <AuthorizationManager> configuration in the user-mgt.xml file:


<Property name= "CaseSensitiveAuthorizationRules"> true </Property>

Step 3: Add a proxy service

You can either create a new proxy service, or import an already created proxy service to your workspace.

Follow the steps given below.

  1. Right-click the ESB Solution project in the navigator and go to New → Proxy Service to open the New Proxy Service dialog.
  2. Let's import the proxy service you downloaded previously. Click Import Poxy Service and Next. Enter values for the following fields:

    Alternatively, you can create a new proxy service.

    Proxy Service Configuration FileBrowse for the proxy service file that you downloaded previously.
    Save in

    The file you import should be saved in an ESB project in your Tooling workspace. To create a new ESB project:

    1. Click Create New ESB Project.
    2. Select New ESB Config Project.
    3. Enter a project name. For example, enter 'ESB_Project' as the project name.
    4. Click Finish. The new ESB_Project is added to the Save in field.
  3. Click Finish. You will now see a new ESB_Project folder (with the proxy service) in your project explorer.

Step 4: Add the security policy to the proxy service

You can now apply the security policy to the proxy service. Follow the steps given below.

  1. Double-click the proxy service on the project explorer to open the file and click on the service on design view.
  2. In the Properties tab shown below and tick on Security Enabled property.
  3. Select the Browse icon for the Service Policies field. In the dialog box that opens, create a new record and click the Browse icon to open the Resource Key dialog as shown below.
  4. Click workspace, to add the security policy from the current workspace. You can select the path to the sample_policy.xml file that you created in the previous steps.
  5. Save the proxy service file.

Step 5: Deploying the artifacts in the ESB server

Once you have added the security policy to your proxy service as explained in the previous topics, you need to create a Composite Application project with a CAR file. You can then deploy the CAR file in the ESB server:

  1. Right-click the Project Explorer and click New > Project.
  2. From the window that opens, click Composite Application Project.
  3. Give a name to the Composite Application project and select the projects that you need to group into your C-App from the list of available projects. You need to select the ESB project and the registry resource project, which contains the proxy service and security policy file respectively.

  4. Next, deploy the CAR file in the ESB server.

Testing the service

Secured proxy services (not including user name token) cannot be tested using the management console. For this, we need to create a Soap UI project with the relevant security settings and then send the request to the hosted service.

  • No labels