Database Reference
In-Depth Information
HR.emp_mobile_nos table. And you will also have edited the company-specific values at the top of
Chapter9/orajavsec/OracleJavaSecure.java . You should also uncomment the top line of
OracleJavaSecure.java and execute it in Oracle database to load the Java structures.
After loading OracleJavaSecure into Oracle database, restore the comment on the top line and save
the file. From a command prompt in the Chapter9 directory, compile both OracleJavaSecure.java and
TestOracleJavaSecure.java with these commands.
javac orajavsec/OracleJavaSecure.java
javac TestOracleJavaSecure.java
Then run the test by executing the first line, java TestOracleJavaSecure , and see the results.
Execute the same command again to see that the two-factor code is not sent again (DistribCd = 0). After
you receive the two-factor authentication code, execute the last command, passing the two-factor code
on the command line.
java TestOracleJavaSecure
DistribCd = 5
Call again with 2-Factor code parameter
java TestOracleJavaSecure
DistribCd = 0
java TestOracleJavaSecure 1234-5678-9012
DistribCd = null
Oracle success 1)
Oracle success 2)
198, Donald, OConnell, DOCONNEL, 650.507.9833, 2007-06-21 00:00:00, SH_CLERK, 26
00 (AD6E5035FAB394A8), null, 124, 50
After 10 minutes have elapsed, the two-factor code will no longer succeed in getting access. Try
executing TestOracleJavaSecure again after 10 minutes with the same code and observe the “no data
found” error message.
java TestOracleJavaSecure 1234-5678-9012
DistribCd = ORA-01403: no data found
Oracle error 1) 100, ORA-01403: no data found
Chapter Review
We enabled Oracle Database to send E-Mail messages and to browse to web pages. Using those abilities,
we developed a process to send 2-factor authentication codes to our application users on their cell
phones, pagers and e-mail accounts. Users will have to enter those 2-factor codes in order to get access
to our application data.
We built a table to hold mobile phone numbers for users and another to hold web addresses of SMS
gateways for each cell phone carrier. We also added a table to hold cached 2-factor codes.
We implemented foreign keys to maintain referential integrity between our tables. And we
discussed a coding standard for exchanging dates between Oracle Database and Java.
An overview of the 2-factor code distribution process is provided in Figure 9-1. Notice a reference in
this Figure to Figure 8-1, block [D] . It was there that we saw an illustration of the process of getting our
SSO proxy connection. Using that connection, we call the p_check_hrview_access procedure two times.
The first time, we don't have a two-factor authentication code. Therefore, we do the process depicted in
 
Search WWH ::




Custom Search