I'm trying to connect to an Oracle database using PHP using the following code:
$username = 'my_username';
$password = 'my_password';
$environment = 'my_environment';
// CHANGE HOST, PORT, SID
$tns = "
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = my_host)(PORT = my_port))
)
(CONNECT_DATA =
(SID = my_sid)
)
)
";
$conn = oci_connect($username, $password, $tns);
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
It is working fine. But what I want to do is connect without exposing the username and password in plain text. Like in Postman where you can use Basic authentication header instead of plain text. Is there a way to do that?