Database Reference
In-Depth Information
Listing 12-57. Grant Appver_Conns Role to the Current User
String updateString =
"BEGIN sys.appver_conns_role_pkg.p_grant_appver_conns_role( " +
"SYS_CONTEXT( 'USERENV', 'CLIENT_IDENTIFIER' ) ); END;";
PreparedStatement pstmt =
conn.prepareStatement(updateString);
pstmt.executeUpdate();
Finally, we take one last step in the registerButton_actionPerformed() method. We create a
placeholder in the v_app_conn_registry view for the connection strings to be used by this new
application. To do that, we change contexts to the context of the new application by calling
setAppContext() . Then we execute the getAppConnections() method, and follow that with a call to
putAppConnections() . That series of commands, shown in Listing 12-58, will create the entry in
v_app_conn_registry .
Listing 12-58. Insert Entry into Application Connections Registry
OracleJavaSecure.setAppContext(
applicationIDTextField.getText().toUpperCase(), appClass, "");
OracleJavaSecure.getAppConnections();
OracleJavaSecure.putAppConnections();
When we set the new application context in Listing 12-58, we provide the application ID that the
user entered along with the class we instantiated from the description on the screen and an empty string
in place of a two-factor authentication code.
Note We have not accomplished two-factor authentication nor key exchange for this new application. When we
call putAppConnections() with an empty list of connections, Oracle database does not balk at decryption and
encryption, but rather inserts an empty conn string list for the new application.
When these steps are complete, the new application has been registered. It still remains that we
need to enter some application connection strings into the list for this application. We can do that on
another functional screen of the Security Administration Interface application.
Recall that after the Register button has been pressed, the Close button changes to an Exit button
that will exit the JVM. Because we have changed application contexts, we cannot return to the OJSAdmin
menu and continue working with the list of connection strings for the OJSAdmin application.
Application Selection Screen
In the functional screens we have discussed so far, we have done all the application security
administration we can as the OJSAdmin application. We even set our context to be that of another
application in order to act on behalf of the application and to register it. But in order to manage the
connection strings associated with a different application, we will have to start out with the identity of
that application.
 
Search WWH ::




Custom Search