php - How save password of a third party application in my app for use with a api? -
i need save third-party application password in php application connect api in background process. need store password in db, , password each user of application. don´t know right way save retrieve after.
i don´t want save password without encryption, don´t know best method (and easy) this
any idea?
unless there's sort of oauth mechanism available api might store in plain text. 1 time attacker has access encrypted form of password more have access code decrypts it.
my preferred method is:
inc.credentials.php
<?php $app_creds = array( 'username' => 'sammitch', 'password' => 'isgreat' );
actual_code.php
<?php require('inc.credentials.php'); app_login($app_creds['username'], $app_creds['password']); unset($app_creds);
always uses file extension that's run through php interpreter file not served plain text. always leave off closing ?>
nil accidentally output. [most whitespace] unset()
paranoia, in case of code injection. php codeigniter
No comments:
Post a Comment