- Security Manager in Apinizer expects Plain-Text type security information from API Client.
- Authentication information is sent to the database to be checked.
- From the database, a response regarding authentication information is returned to Apinizer. If this authentication cannot be verified, Apinizer stops the request and returns an error message. If verification can be performed, the flow continues.
- Apinizer makes a request to Backend API.
- Backend API responds to Apinizer.
- Apinizer transmits the response to API Client.

Creating API Proxy

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



- The Usage field specifies who will use the created API Proxy. Options such as publisher, consumer, publisher and consumer are available here.
- The Sharing Type field specifies the sharing type of the created API Proxy. Options such as external, internal, external and internal are available here.
- 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.


Policies to be added with the All expression above these endpoints can be applied to all endpoints.

Establishing Database Connection
Click the Database menu under the Connection Management menu.If no database definition has been made before, the text No records found! may be seen on this page.

- The Name field expresses the name of the connection to be created.
- A description can be added to the created connection with the Description expression.
- Write the JDBC address required to connect to the database to be connected to with the JDBC URL field. This information can be obtained from the database team.
- Enter the username information to be used during connection with the Username field, and enter the password to be used during connection with the Password field.



Adding Database Authentication Connections
Go to Identity Management > Identity Providers > Database section to add the database authentication definition created earlier.
Database Authentication Connection
Press the Create button and enter connection settings:- Enter name and description for the connection.
- If the password information in the table to be used in the database connection is kept encrypted, the encryption type of the password stored in the table must be selected with Encryption Type.
- Select the database prepared in previous steps with the Database Connection Pool Definition field.
- A query is used to retrieve username/password pairs or role lists from the database. The username parameter in the query must be defined as
:usernameand the password parameter as:password. Apinizer recognizes the colon character and processes accordingly, knowing that the relevant parameter will be sent from outside.

Database Authorization Connection
The only difference from the authentication connection is the query entered. Since identity authorization will be performed in this field, only the name of the relevant role is retrieved in the query section.
Creating Authentication Policy
Go to the page where API proxies are listed and select the proxy named Swagger Petstore from here. Go to the Develop tab and click the Add Policy button. On the opened page, the Plain-Text Authentication policy is selected.
- Select the database from the Identity/Role/Group Service field that will provide the control.
- 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 expected and retrieved from the username and password values in the header.
- The Add Client Info To Header option enables the username to be transmitted in a separate header value in the Header going to the backend API.
- The Authorization Configuration field is the field where rules related to the roles of users whose authentication has been performed can be entered.
- If the Add Roles To Header option is selected, if authorization is successful, it adds the client’s roles to the “X-Authenticated-UserRoles” header.
- Select the database from the Identity/Role/Group Service field where role information is located. This is usually done with the same definition as the database that provides identity control.
- Enter the roles to be authorized in the Roles/Group field.
- Set whether the client needs to have all or any of the roles/groups defined here to access the API.
- When the Enable Role/Group Based Method Access option is selected, first the roles granted access to the API are checked. Then, other roles are looked at to control access to methods.

The relevant icon is seen when the policy is registered.

Testing the API Proxy
After selecting an endpoint such as “/pet/”, click the Test Endpoint button.



