PDO to Oracle db and secure external password store aka wallet for authentication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

I am wondering how it would be possible to use authentication using a secure external password store aka wallet with PDO OCI.

See Oracle external authentication and OCI_CRED_EXT in the underground php oracle manual.

and

https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/configuring-authentication.html#GUID-803496D2-19C7-4F02-94EC-C13EDD8FB17B
(jump to chapter 3.2.9)


Following works fine with oci8:
$conn = oci_connect('/', '', $db, 'UTF8',OCI_CRED_EXT);

note the OCI_CRED_EXT!

But how can pass that option to a PDO OCI connection?
Following might be close, but does not work:

  $opt = [
      PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
      PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_NUM,
      'session_mode' => OCI_CRED_EXT,

];

  try{
      $conn = new PDO("oci:dbname=".$db.';charset=UTF8', "/","", $opt);
  }
  catch(PDOException $e){
      echo ($e->getMessage());
  }

Is it possible at all?

Thanks in Advance
Mathias Zarick

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux