AppTokenGen JCCV12.1
AppTokenGen JCCV12.1
Document Control
5 V 1.0
Reviewers
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
1
766364188.docx
Approvals
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
2
766364188.docx
Table of Contents
1 Executive Summary..............................................................................................3
2 App Token Generation overview..........................................................................3
3 Requirement.........................................................................................................3
4 Solution:................................................................................................................4
5 List of JCC changes..............................................................................................5
6 App Token Registration........................................................................................6
7 SQL queries for Server set up..............................................................................6
8 Create Trusted Context........................................................................................8
7. Connectivity..........................................................................................................8
8. Test Scenarios covered........................................................................................8
9. Documentation updates.......................................................................................9
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
3
766364188.docx
1 Executive Summary
This is the functional specification document for DB2 JCC driver for App Token
Generation. This document covers the details for SAP Audit Exception - Application
Token Generation feature in version 12.1.0.
3 Requirement
The initial requirement is to support identifying a client application via an Application
Identification token, or apptoken for short.
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
4
766364188.docx
4 Solution:
The solution consists of these three components.
Overview of changes
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
5
766364188.docx
DRDA changes
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
6
766364188.docx
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
7
766364188.docx
8. The implementation of how the APPTKN is generated is left to the client with
source server acting as transport for the value.
9. The APPTKN will be validated by a customer provided stored procedure to
determine if a Trusted Connection should be established. (Logic for validation is
out of scope for JCC driver.)
10. CONNONCE – random 128-bit number. The target server with Security Manager
level 11 will always send back a CONNONCE on ACCSECRD, regardless of
security mechanism used, so it does not need to be requested.
11. AES_CMAC algorithm which uses block cipher encryption is used to diversify
the CONNONCE before it is sent to the customer app token api for generating
the APPTKN.
12. The response from the customer APP Token API implementation will be the
APPTKN that is sent over the DRDA to the server.
13. Once the APPTKN is sent over the DRDA no specific response is expected.
14. The trusted connection is established only when the APPTKN sent over DRDA is
validated at the server via the Trust Procedure provided by the customer.
new com.ibm.db2.jcc.DB2ConnectionPoolDataSource();
Object[] objects = new Object[2];
//Please note that for property: appTokenGenClassName the value should be mentioned along
// with the package as set below.
properties.setProperty("appTokenGenClassName","apptokengen.CustomDb2AppTokenGen");
b. Using datasource
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
8
766364188.docx
com.ibm.db2.jcc.DB2ConnectionPoolDataSource dataSource =
new com.ibm.db2.jcc.DB2ConnectionPoolDataSource();
Object[] objects = new Object[2];
dataSource.setAppTokenGen(apptokengen);
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
9
766364188.docx
END IF;
END;
db2 commit;
db2stop force
db2start
The trust_proc will be called for every connect. You cannot replace or drop the
trust_proc while it is in use by an activated database.
The trust_proc procedure will be called prior to connect_proc so that it cannot influence
in any way values that might be used by trust_proc.
For example:
CREATE TRUSTED CONTEXT " +ctname +" BASED UPON CONNECTION USING SYSTEM
AUTHID " +testuser +" ATTRIBUTES (ADDRESS '"+ip+"', TRUST PROCEDURE
TEST.PROC1) ENABLE WITH USE FOR PUBLIC WITH AUTHENTICATION
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
10
766364188.docx
7. Connectivity
T4 LUW
9. Documentation updates.
https://www.ibm.com/docs/en/db2/11.5?topic=pdsdjs-common-data-server-driver-jdbc-
sqlj-properties-all-database-products
appTokenGen
The AppTokenGen feature for SAP audit exception will be available only with security
manager level 11 and above. (DB2 12.1 version onwards).
The DB2 server must have all the necessary set up done before making the trusted
connection call with the app token details as given in the below link.
https://www.ibm.com/docs/en/db2/11.5?topic=statements-create-trusted-context
https://www.ibm.com/docs/en/db2/11.5?topic=connections-trusted-contexts-trusted
https://www.ibm.com/docs/en/db2/11.5?topic=views-configuration-routines
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
11
766364188.docx
Java based clients must register the callback programmatically when creating the
trusted connection.
new com.ibm.db2.jcc.DB2ConnectionPoolDataSource();
Object[] objects = new Object[2];
//Please note that for property: appTokenGenClassName the value should be mentioned along
// with the package as set below.
properties.setProperty("appTokenGenClassName","apptokengen.CustomDb2AppTokenGen");
b. Using datasource
com.ibm.db2.jcc.DB2ConnectionPoolDataSource dataSource =
new com.ibm.db2.jcc.DB2ConnectionPoolDataSource();
Object[] objects = new Object[2];
dataSource.setAppTokenGen(apptokengen);
© Rocket Software, Inc. or its affiliates 1990–2022. All rights reserved. Rocket and the Rocket Software logos are
registered
trademarks of Rocket Software, Inc. Other product and service names might be trademarks of Rocket Software or
its affiliates.
12