Saturday, January 4, 2014

How to change or reset keystore passwords in OAM or OVD

[IDM_HOME]/common/bin/wlst.sh

connect('weblogic_idm','*****','t3://idmhost.mycompany.com:7001');



help('all')       List all WLST commands available.



wls:/IDMDomain/serverConfig> domainRuntime()
Already in Domain Runtime Tree



wls:/IDMDomain/domainRuntime>  listCred(map="OAM_STORE",key="jks")
Already in Domain Runtime Tree

[Name : jks, Description : null, expiry Date : null]
PASSWORD:shr0957elmn5p90idoodohu5no


If you want to change OVD kystore password:

resetKeystorePassword()  --Deprecated

changeKeyStorePassword('inst1', 'ovd1', 'ovd','keys.jks', 'currpassword', 'newpassword')


or use the command prompt(OAM example):

keytool -list -keystore oamclient-truststore.jks
Enter keystore password: <SIMPLE HIT ENTER>

*****************  WARNING WARNING WARNING  *****************
* The integrity of the information stored in your keystore  *
* has NOT been verified!  In order to verify its integrity, *
* you must provide your keystore password.                  *
*****************  WARNING WARNING WARNING  *****************

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

oam.simple.ca, Nov 12, 2014, trustedCertEntry,
Certificate fingerprint (MD5): 05:F4:8C:84:85:37:DB:E3:66:87:EF:39:E0:E6:B2:3F

============================================
another Demo example:
keytool -list -keystore /u01/app/idm/products/app/wlserver_10.3/server/lib/DemoTrust.jks
Enter keystore password:<SIMPLE HIT ENTER>

*****************  WARNING WARNING WARNING  *****************
* The integrity of the information stored in your keystore  *
* has NOT been verified!  In order to verify its integrity, *
* you must provide your keystore password.                  *
*****************  WARNING WARNING WARNING  *****************

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 4 entries

certgenca, Mar 22, 2002, trustedCertEntry,
Certificate fingerprint (MD5): 8E:AB:55:50:A4:BC:06:F3:FE:C6:A9:72:1F:4F:D3:89
wlsdemocanew2, Jan 24, 2003, trustedCertEntry,
Certificate fingerprint (MD5): 5B:10:D5:3C:C8:53:ED:75:43:58:BF:D5:E5:96:1A:CF
wlsdemocanew1, Jan 24, 2003, trustedCertEntry,
Certificate fingerprint (MD5): A1:17:A1:73:9B:70:21:B9:72:85:4D:83:01:69:C8:37
wlscertgencab, Jan 24, 2003, trustedCertEntry,
Certificate fingerprint (MD5): A2:18:4C:E0:1C:AB:82:A7:65:86:86:03:D0:B3:D8:FE


In order to change the password run this:
keytool -storepass changeit -storepasswd -keystore /u01/app/idm/config/domains/IDMDomain/output/webgate-ssl/oamclient-keystore.jks


I hope it helps,
Thiago Leoncio

Saturday, December 28, 2013

Article how to delete system properties

Hello everybody,

Today I will cover how to delete system property in OIM 11g + some important details related of system properties.

1)Here it is the first code:
...
   SystemConfigurationService confServiceDel = oimClient.getService(SystemConfigurationService.class);
   try{
     SystemProperty sysProp;
     sysProp = confServiceDel.getSystemProperty(sysproperty);
     lgb=confServiceDel.deleteSystemProperty(sysProp.getPtyKeyword(), new Date());
                   
    }catchInvalidDataLevelException e){
        System.out.println("DataLevel issues:"+e);
....

[add here the conditions that you want to work if this happens...]
....


2)***Very important note***
You can delete a system property only if the data level of that system property is set to either 0 or 3. While deleting a system property, a message is displayed if the data level associated with the system property is not appropriate. For a description of the data levels, see Table below, "Data Levels Associated with a System Property".

2.1)DataLevel X description
===================================================
Data Level Description
0                      Indicates that the system property can be modified or deleted

1                      Indicates that the system property cannot be modified or deleted

2                      Indicates that the system property can only be modified

3                      Indicates that a system property can only be deleted
===================================================

3)This above is the main reason why you need to take care closely on exception InvalidDataLevelException . Also make sure during the system property creation or update you set the datalevel related.

3.1)during creation:
   ...
                    SystemProperty syspropcreation = new SystemProperty();
                    syspropcreation.setPtyKeyword(sysproperty);
                    syspropcreation.setPtyNote("Code implemented by ThiagoLeoncio");
                    syspropcreation.setPtyName(sysproperty);
                    syspropcreation.setPtyValue(syspropvalue);
                    syspropcreation.setPtyCreate(new Date());
                    syspropcreation.setPtyUpdate(new Date());
                    syspropcreation.setPtyDataLevel("0");  // <== IMPORTANT PIECE
                    syspropcreation.setPtyUpdateby("13");
                    syspropcreation.setPtyCreateby("13");
                    confService.addSystemProperty(syspropcreation);
   ...
3.2)during update:
...
sysPropUpd.setPtyDataLevel("0");
confServiceUpd.updateSystemProperty(sysPropUpd,new Date());
...

4)Reference:
4.1)http://docs.oracle.com/cd/E21764_01/doc.1111/e14308/system_props.htm#BABFCDAD
4.2)http://docs.oracle.com/cd/E37115_01/apirefs.1112/e28159/oracle/iam/conf/api/SystemConfigurationService.html


I hope this helps.
Thiago Leoncio.