> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Application of Plain-Text Authentication Policy to SOAP Web Service via Security Manager Provider

> Explains how to apply Plain-Text Authentication policy to Calculator SOAP web service via Security Manager provider. Includes all steps from API Proxy creation to credential definition, adding policy to testing.

The numbering in the diagram below corresponds to the **order of operations**.

* **Security Manager** in **Apinizer** requests **Plain-Text type authentication** information from **API Client**. If this **authentication** information is correct, proceed to field number two.
* **Apinizer** makes a request to **Backend API**.
* **Backend API** responds to **Apinizer**.
* **Apinizer** responds to **API Client**.

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo1.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=aa3e5c64acf513f6af7595e8ce9c448c" alt="Scenario Diagram" width="800" data-path="images/tutorials/senaryo1.png" />

## Creating API Proxy

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo2.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=052195ac9313eff2da0121245624677f" alt="Scenario Diagram" width="200" data-path="images/tutorials/senaryo2.png" />

Access to the web service named Calculator can be provided from [http://www.dneonline.com/calculator.asmx?WSDL](http://www.dneonline.com/calculator.asmx?WSDL).

First, this address must be defined as an **API Proxy**.

For this, click the **API Proxies** option under the **Development** menu.

Since no **proxy** definition has been made before on the opened page, the text **No records found!** appears.

Here, click the **Create** button in the top right corner and start creating a new **proxy**.

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo3.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=938b0de54e7641fce65b865f3f5182b0" alt="Scenario Diagram" width="800" data-path="images/tutorials/senaryo3.png" />

Since the API proxy to be added is a SOAP web service, click on the **Enter URL** expression from the **WSDL menu** to switch to the screen where the address of the web service to be used will be entered.

<img src="https://mintcdn.com/apinizer/aOIH-4QxMAw_nc-p/images/tutorials/wsdl.png?fit=max&auto=format&n=aOIH-4QxMAw_nc-p&q=85&s=0e13bfeaa27bfde0cb3a51cbdc18819b" alt="Senaryo Diyagramı" width="800" data-path="images/tutorials/wsdl.png" />

As seen in the image below, enter the **address to be accessed** in the URL section and click the **Parse** button.

<img src="https://mintcdn.com/apinizer/CjY5_esa4pwiobby/images/tutorials/soap2.png?fit=max&auto=format&n=CjY5_esa4pwiobby&q=85&s=661edf30bca678242d74fba5022f8f7e" alt="Scenario Diagram" width="800" data-path="images/tutorials/soap2.png" />

After performing the parsing, the screen shown in the image below appears. Settings for the API Proxy can be made from this screen.

* The **Usage** field specifies who will use the created API Proxy. Options such as **publisher, consumer, publisher and consumer** are available here.
* There are two different options under the **Protocol Transformation** tab;
  * **Pass-Through SOAP** allows the SOAP web service to be used as is without performing any transformation operations on the web service.
  * **REST to SOAP to REST** allows this SOAP web service to be used in a structure that will include REST architecture.
* One or both of the two API addresses under the **Addresses** tab can be selected. If both addresses are selected, Apinizer will perform the **Load Balance** operation itself.
* **Relative Path** is the address where the created API Proxy will be opened for access.
* The **Category List** field also allows categorization of the created API Proxy.

<img src="https://mintcdn.com/apinizer/CjY5_esa4pwiobby/images/tutorials/soap3.png?fit=max&auto=format&n=CjY5_esa4pwiobby&q=85&s=5a7d116ebd6d8e1168100940e3dedb12" alt="Scenario Diagram" width="800" data-path="images/tutorials/soap3.png" />

After these settings are made, the API Proxy is saved.

After the save operation, click the **Develop** tab on the opened page.

<img src="https://mintcdn.com/apinizer/CjY5_esa4pwiobby/images/tutorials/soap4.png?fit=max&auto=format&n=CjY5_esa4pwiobby&q=85&s=c029b1b352c66fa4ba1b5dff133e1b93" alt="Scenario Diagram" width="800" data-path="images/tutorials/soap4.png" />

Here, the **methods** belonging to the web service are seen.

* Policies to be added with the **All** expression above these methods can be applied to **all methods**.
* The created API Proxy is deployed. For this, click the **Deploy** button in the middle section above.

<img src="https://mintcdn.com/apinizer/CjY5_esa4pwiobby/images/tutorials/soap5.png?fit=max&auto=format&n=CjY5_esa4pwiobby&q=85&s=b86df05ffea4596397fa8cde8f37789e" alt="Scenario Diagram" width="800" data-path="images/tutorials/soap5.png" />

## Creating Credentials

The information for the **Credential** to be added will be **username = apinizer**, **password = 123123aA**.

For this, go to the **Identity Management** menu.

Here, click the **Credentials** menu under the **Credential Management** menu.

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo9.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=b6251e96ba25024507bf54bb9c42088e" alt="Scenario Diagram" width="200" data-path="images/tutorials/senaryo9.png" />

Click the **Create** button in the top right corner on the opened screen.

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo10.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=7f11ddaa0164cd3fe50bb9632b47235a" alt="Scenario Diagram" width="600" data-path="images/tutorials/senaryo10.png" />

Here, the required fields are filled with the previously specified information and the created **credential** is saved by clicking the **Save and Deploy** button.

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo11.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=69a55f3f592c442fb8b0606c6e226b08" alt="Scenario Diagram" width="800" data-path="images/tutorials/senaryo11.png" />

The proxy that this **credential element** will provide access to must be selected. Hover over the created **credential** and click the **Edit** option from the menu on the side.

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo12.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=bef3068f5bab8cd8bdb0db0989543527" alt="Scenario Diagram" width="800" data-path="images/tutorials/senaryo12.png" />

Click the **API Proxy ACL** tab from the opened screen, and click the button in this tab.

<img src="https://mintcdn.com/apinizer/bxDpmriTStVknLzL/images/tutorials/api-proxy-acl.png?fit=max&auto=format&n=bxDpmriTStVknLzL&q=85&s=4382f031671c9a1db129f0cbec08544f" alt="Scenario Diagram" width="800" data-path="images/tutorials/api-proxy-acl.png" />

On the opened page, **API Proxies** in the project currently being worked on are listed. The **proxy** named **Calculator** is selected.

Click the **Add** button to specify that the created **Credential** element will have access to this **proxy**.

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo14.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=86bfab93f7d0e4dfe924a20118d31bce" alt="Scenario Diagram" width="600" data-path="images/tutorials/senaryo14.png" />

Click the **Save and Deploy** button in the top right corner and save the operation.

## Adding Authentication Policy

The **Plain-Text Authentication** policy can now be added.

Go to the page where API Proxies are listed and select the proxy named **Calculator** from here.

Then go to the **Develop** tab and click the **Add Policy** button.

On the opened page, the **Plain-Text Authentication** policy is selected.

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo16.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=367541a5209beddc52b5a66748f67fba" alt="Scenario Diagram" width="800" data-path="images/tutorials/senaryo16.png" />

The fields on this screen:

* The value to be selected in the **Identity/Role/Group Service** field is the **Security Manager** value. Because credentials control will be performed by **Security Manager**.
* The **Variable for username** and **variable for password** expressions also select which variable the username and password information will be retrieved with. In this scenario, these values will be retrieved from **header**.
* If the **Clear Authentication Information** option is selected, authentication information in the incoming message is deleted.
* The **Add Client Info To Header** option specifies whether client information will be present in the Header going to the backend API.
* If this option becomes active, another parameter named **Authenticated User Header Name** appears.
* The **X-Authenticated-UserId** expression here specifies the header name with which the client information going to the backend API will go.

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo17.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=3dec8d31134c4c49e49c86bb4206cd43" alt="Scenario Diagram" width="800" data-path="images/tutorials/senaryo17.png" />

For the operation to be valid, the proxy must be **Deployed**.

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo18.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=c4ae1f9417beee2244f0043a329af45b" alt="Scenario Diagram" width="800" data-path="images/tutorials/senaryo18.png" />

## Testing the API Proxy

After selecting the **Add** method, click the **Test Method** button.

<img src="https://mintcdn.com/apinizer/VUbwu9iu7Snx108F/images/tutorials/senaryo19.png?fit=max&auto=format&n=VUbwu9iu7Snx108F&q=85&s=0fc2801a24872962da9cfd6b67800561" alt="Scenario Diagram" width="800" data-path="images/tutorials/senaryo19.png" />

After writing the desired values in the Body, click the **Send** button and make a request to the **backend API**.

<img src="https://mintcdn.com/apinizer/CjY5_esa4pwiobby/images/tutorials/soap6.png?fit=max&auto=format&n=CjY5_esa4pwiobby&q=85&s=2e4ab1e7c107efb106444849c6a0ae85" alt="Scenario Diagram" width="800" data-path="images/tutorials/soap6.png" />

As seen in the image below, since no **authentication** information is sent to the **backend API**, the error message in the rectangle is received as a response.

<img src="https://mintcdn.com/apinizer/CjY5_esa4pwiobby/images/tutorials/soap7.png?fit=max&auto=format&n=CjY5_esa4pwiobby&q=85&s=bb80f88cad298f29ed306b94da20513a" alt="Scenario Diagram" width="800" data-path="images/tutorials/soap7.png" />

This time, enter **username** and **password** expressions in the header and repeat the test.

Enter the values **username = apinizer**, **password = 123123aA** in the **headers** to be sent to the **Backend API**.

When the **Send** button is clicked, a successful response is received.

<img src="https://mintcdn.com/apinizer/CjY5_esa4pwiobby/images/tutorials/soap8.png?fit=max&auto=format&n=CjY5_esa4pwiobby&q=85&s=882c448eddfb228b6ea01de0d7634b0d" alt="Scenario Diagram" width="800" data-path="images/tutorials/soap8.png" />
