# Secure your App using credentials

Username and Password can be used to keep your DBSync Cloud Replication more secured. The below steps should be followed to setup username and password.

* Go to **Install Folder** > **conf** > **tomcat-users.xml**
* **tomcat-users.xml** should be edited by including the below code at the end just before **\</tomcat-users>**

> \<role rolename="manager"/>\
> &#x20;  \<role rolename="tomcat"/>\
> &#x20;  \<role rolename="admin"/>\
> &#x20;  \<role rolename="role1"/>\
> &#x20;  \<role rolename="dbsync"/>\
> &#x20;  \<user username="manager" password="manager" roles="manager"/>\
> &#x20;  \<user username="both" password="tomcat" roles="tomcat,role1"/>\
> &#x20;  \<user username="tomcat" password="tomcat" roles="tomcat"/>\
> &#x20;  \<user username="role1" password="tomcat" roles="role1"/>\
> &#x20;  \<user username="adminuser" password="adminpassword" roles="admin"/>\
> &#x20;  \<user username="repl" password="avankia1" roles="dbsync"/>

* In this code, you need to specify the username and password that you would like to setup for admin role.
* In this example, username is adminuser and password is adminpassword for role admin.

> \<security-constraint>\
> &#x20;  \<web-resource-collection>\
> &#x20;     \<web-resource-name>**admin**\</web-resource-name>\
> &#x20;     \<url-pattern>/\*\</url-pattern>\
> &#x20;                 \<http-method>GET\</http-method>\
> &#x20;               \<http-method>POST\</http-method>\
> &#x20;   \</web-resource-collection>\
> &#x20;   \<auth-constraint>\
> &#x20;     \<role-name>tomcat\</role-name>\
> &#x20;                 \<role-name>**admin**\</role-name>\
> &#x20;   \</auth-constraint>\
> \</security-constraint>\
> \<login-config>\
> &#x20;      \<auth-method>BASIC\</auth-method>\
> \</login-config>
>
> \<security-role>\
> &#x20;    \<role-name>**admin**\</role-name>\
> \</security-role>

* Save these changes and close **web.xml**
* Restart tomcat and try to access DBSync Cloud Replication User Interface.

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mydbsync.com/cloud-replication-main/troubleshooting/secure-your-app-using-credentials.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
