Thursday, June 23, 2011

OIM 9x : Useful DB Queries for Debugging OIM

1. Get resource objects to operate for a user. This happens during access policy evaluation when user is being created.
- Post Event during user creation process.
Query
-----
select obj.obj_key, obj.obj_name, obj.obj_allow_multiple, obj.obj_allowall, pop.pop_denial, pop.pop_revoke_object from pop pop, obj obj where pop.pol_key = 41 and pop.obj_key = obj.obj_key;
Results
--------
108 RO_A 1 1 0 0
109 RO_B 1 1 0 1
110 RO_C 1 1 0 1

2. List of provioned objects for an user
Query
-----
select * from oiu oiu, obj obj, obi obi, ost ost where oiu.obi_key = obi.obi_key and obi.obj_key = obj.obj_key and oiu.usr_key = 161 and oiu.ost_key = ost.ost_key and ost.ost_status != 'Revoked';

3. Get a particular task from a provisioning process
Query
------
select mil_key, mil_name, mil_sequence, mil_day, mil_hour, mil_minute,mil_create_multiple, mil_cancel_while_pending, mil_comp_on_rec, mil_required_complete, mil_retry_period, mil_retry_count, evt_key, mil_default_assignee, mil_assign_to_manager from mil where mil_key=373;
Results
-------
373 Enable User 0 1 1 0 0 1

Wednesday, June 22, 2011

OIM 9x : Membership auto-assign

1. Goto Design Console GUI --> Resource Management --> Rule Designer,
Create a new rule as -
* GroupMemMiddleName : Rule Type - "General" : Rule Sub Type - Empty : Rule Operator - "AND"
* Save it.
* Add a new "Rule Elemenent" - "Middle Name == Roger"
* Save it.

2. Goto Browser UI --> Manage User Groups --> "Test Group" --> Memebership Rules
Assign this new rule to the group.

Now if a new user with middle name Roger is created, he will be member of this "Test Group" automatically.

Adding tasks to a Provisioning Process

Create User : "Required for Completion" : tcCompleteTask : C-Completed-Provisioned : None for "Task Effect"

Delete User : "Conditional" : tcCompleteTask : C-Completed-Revoked : None for "Task Effect"

Enable User : "Conditional" : tcCompleteTask : C-Completed-Revoked : "Enable Process or Access to Application" for "Task Effect"

Disable User: "Conditional" : tcCompleteTask : C-Completed-Revoked : "Disable Process or Access to Application" for "Task Effect"

* With above tasks in a provisioning process, when you enable a user, Enable User task in Provisioning process will kick-in. This will kick-in not because of task name but because of Task-Effect configured above.

* With above tasks in a provisioning process, when you disable a user, Disable User task in Provisioning process will kick-in. This will kick-in not because of task name but because of Task-Effect configured above.

========================================
How to define reserved names for tasks?
========================================
* In Design Console GUI --> Administration --> Lookup Definition, Type *trigger* in "Code" text box --> Click Lookup in toolbar menu.
* In Lookup Definition Table --> Select "Lookup.USR_PROCESS_TRIGGERS"
You will get a "Code Key" - "Decode" table

In this table, you will see that task names are defined for a particular operation. For ex: "USR_FIRST_NAME" - "Change First Name"
So if you define a task in Provisioning process with task name "change First Name", then OIM will trigger this particular task when user profile modifies for "First Name" field.

You can extend this table for new tasks if needed.

=================
Test Case to try:
==================
Define a provisioning process for resource object Laptop. Add a new task

Create User : "Required for Completion" : tcCompleteTask : C-Completed-Provisioned : None for "Task Effect"

1. Try provisiong this resource object Laptop to test user - tu1. Provisioning will happen.
2. Disable the user. You will see that OIM reports that - there is no task for Disable.

======
Notes
======
* OIM operates task-based. If a particular task "Disable User" with Task Effect as described above in 10 Provisioning Processes. If a user - tu1 is disabled, then all 10 provisioning processes - tasks will be triggered.

Wednesday, June 15, 2011

Designing Shuttle boxes in ADF UI

Code Example: GoogleCodeLink

PanelStretchLayout Geometry - Link

Some discussion:
1. OTN-Thread1
2. OTN-Thread2
3. OTN-Thread3

ADF Documentation
1. ADF Overview
2. JDEV Overview

Monday, June 13, 2011

Creating new sample ADF tab in OIM 11g

Oracle Deployment doc: OracleDocLink

Step-1 : Copy src code of new tab
======
ade:[ lakshman_IAM0612 ] [lakshman@parrot lib]$ pwd
ade:[ lakshman_IAM0612 ] [lakshman@parrot lib]$ /scratch/lakshman/view_storage/lakshman_IAM0612/tklocal/oimDeployments/oim.ear/iam-consoles-faces.war/WEB-INF/lib/.
ade:[ lakshman_IAM0612 ] [lakshman@parrot lib]$ cp /work/lakshman/bugs/tabBug/cuFiles/CustomTabApp/deploy/adflibCustomTabs1.jar .

Step-2: No need to do any change in Self.jspx
=======


Step-3 : Make changes to faces-config-self.xml
======

ade:[ lakshman_IAM0612 ] [lakshman@parrot oim.ear]$ diff ./iam-consoles-faces.war/WEB-INF/faces-config-self.xml /work/lakshman/bugs/tabBug/myChanges/faces-config-self.xml
235a236,250
>
> customPage
> oracle.iam.consoles.faces.backing.Self$OperationAction
> application
>
> id
> java.lang.String
> customization_page
>

>
> pageUrl
> java.lang.String
> /examples/MyProfile.jspx
>

>

258a274,277
>
> #{customPage.id}
> #{customPage}
>



ade:[ lakshman_IAM0612 ] [lakshman@parrot oim.ear]$ cp /work/lakshman/bugs/tabBug/myChanges/faces-config-self.xml ./iam-consoles-faces.war/WEB-INF/faces-config-self.xml


Step-4: Copy Self.properties
=======
* cp iam-consoles-faces.jar /work/lakshman/bugs/tabBug/myChanges/
* cd /work/lakshman/bugs/tabBug/myChanges/
* mkdir dir_iam-consoles-faces.jar
* mv iam-consoles-faces.jar ./dir_iam-consoles-faces.jar/
* cd ./dir_iam-consoles-faces.jar/
* jar -xvf iam-consoles-faces.jar
* rm iam-consoles-faces.jar
* cp ../Self.properties ./oracle/iam/consoles/faces/resources/Self.properties
* cd /work/lakshman/bugs/tabBug/myChanges/dir_iam-consoles-faces.jar
* jar -cvf ../iam-consoles-faces.jar ./*
* jar -tvf /work/lakshman/bugs/tabBug/myChanges/iam-consoles-faces.jar - Check if there is anything wrong.
* cd /scratch/lakshman/view_storage/lakshman_IAM0612/tklocal/oimDeployments/oim.ear/iam-consoles-faces.war/WEB-INF/lib
* cp /work/lakshman/bugs/tabBug/myChanges/iam-consoles-faces.jar ./

Step-5: Restart wls server
=======

Step-6: Make changes and re-test
=======
When the user first accesses the Self Service console and a custom ADF tab the MyProfile.jspx file is copied into iam-consoles-faces.war. This file will need to be deleted when any new changes to the source file are redeployed.
Delete: oim.ear/iam-consoles-faces.war/examples/MyProfile.jspx
Note: this file will only exist after a user access the Self Service console.

********
Notes:
********
* Use latest JDev 11g for ADF development.
* Mapping between MyProfile.jspx and CustomUserProfile.java (bean class with business logic) is provided in faces-config.xml. You have managed bean name, class etc... here
* In MyProfile.jspx, we reference all business logic using beanName.logic. Example:
inputText label="#{customtabsBundle.EMAIL}"
value="#{profile.userprofile.email}" id="abc"

commandButton text="#{customtabsBundle.APPLY}"
actionListener="#{profile.updateAction}"
id="xyz"
where profile is bean name, useprofile is data member of this bean class.

Wednesday, March 30, 2011

oamcfgtool commands

----- Create -------

[root@adc2171727 oracle.oamprovider_11.1.1]# /work/installations/oracle/middleware/jrockit_160_22_D1.1.1-3/bin/java -jar oamcfgtool.jar mode=CREATE app_domain="domain1" cookie_domain=".us.oracle.com" protected_uris="/em,/console" app_agent_password="welcome1" ldap_host="parrot.us.oracle.com" ldap_port=5389 ldap_userdn="cn=Directory Manager" ldap_userpassword=password ldap_base="dc=us,dc=oracle,dc=com" oam_aaa_host=parrot.us.oracle.com oam_aaa_port=6522
Mar 30, 2011 1:26:39 AM oracle.security.oam.oamcfg.OAMCfgGlobalConfigHandler constructGlobalConfig
INFO: Processed input parameters
Mar 30, 2011 1:26:40 AM oracle.security.oam.oamcfg.OAMCfgGlobalConfigHandler constructGlobalConfig
INFO: Initialized Global Configuration
Mar 30, 2011 1:26:49 AM oracle.security.oam.oamcfg.create.impl.OAMCfgConfigCreator doCreate
INFO: Successfully completed the Create operation.
Mar 30, 2011 1:26:49 AM oracle.security.oam.oamcfg.create.impl.OAMCfgConfigCreator doCreate
INFO: Operation Summary:
Mar 30, 2011 1:26:49 AM oracle.security.oam.oamcfg.create.impl.OAMCfgConfigCreator doCreate
INFO: Policy Domain : domain1
Mar 30, 2011 1:26:49 AM oracle.security.oam.oamcfg.create.impl.OAMCfgConfigCreator doCreate
INFO: Host Identifier: domain1
Mar 30, 2011 1:26:49 AM oracle.security.oam.oamcfg.create.impl.OAMCfgConfigCreator doCreate
INFO: Access Gate ID : domain1_AG
[root@adc2171727 oracle.oamprovider_11.1.1]#

----- Delete -------

[root@adc2171727 oracle.oamprovider_11.1.1]# /work/installations/oracle/middleware/jrockit_160_22_D1.1.1-3/bin/java -jar oamcfgtool.jar mode=DELETE authn_schemes="OraDefaultI18NFormAuthNScheme" ldap_base="dc=us,dc=oracle,dc=com" ldap_host=parrot.us.oracle.com ldap_port=5389 ldap_userdn="cn=Directory Manager" ldap_userpassword=password oam_aaa_host=parrot.us.oracle.com oam_aaa_port=6522
Mar 30, 2011 1:55:31 AM oracle.security.oam.oamcfg.OAMCfgGlobalConfigHandler processOAMCfgParams
INFO:
This operation would delete the parameters specified and cannot be undone...
If needed, type 'No' and refer help (java -jar jar -help)
Enter Yes to continue deletion and No to exit
Yes
Mar 30, 2011 1:55:35 AM oracle.security.oam.oamcfg.OAMCfgGlobalConfigHandler constructGlobalConfig
INFO: Processed input parameters
Mar 30, 2011 1:55:35 AM oracle.security.oam.oamcfg.OAMCfgGlobalConfigHandler constructGlobalConfig
INFO: Initialized Global Configuration
Mar 30, 2011 1:55:35 AM oracle.security.oam.oamcfg.delete.impl.OAMCfgConfigDeleter doDelete
INFO: Successfully completed the Delete operation.
[root@adc2171727 oracle.oamprovider_11.1.1]#

Friday, February 18, 2011

Configuring Password Policy in Oracle Access Manager (Formerly Oblix NetPoint)

Configuring OAM (Access and Identity System) to use password policy is not very obvious. There is no single document or post that describes all required steps at one place. Hence this effort.

=======
Step-1: Import ldifs to DS configured against OAM.
=======

* Create an ldif file - lpm.ldif with following schema change (for LPM functionality)
---------------------
dn: cn=schema
changetype: modify
add: attributetypes
attributetypes: ( 1.3.6.1.4.1.9999.1.1094.204 NAME 'myChallenge' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )

dn: cn=schema
changetype: modify
add: attributetypes
attributetypes: ( 1.3.6.1.4.1.9999.1.1094.205 NAME 'myResponse' SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )

dn: cn=schema
changetype: modify
add: objectclasses
objectclasses: ( 1.3.6.1.4.1.9999.1.1094.206 NAME 'oblixAuxPerson4LPM' DESC 'User defined objectclass' SUP top AUXILIARY MAY ( myChallenge $ myResponse ) )
---------------------

Import above lpm.ldif to DS containing user data.

* Create ldif pwd.ldif with following data entry.
Note : schema change for this class was already done as part of Oblix Schema change during setup.
---------------------
dn:obclass=oblixPersonPwdPolicy,o=Oblix,dc=red,dc=iplanet,dc=com
objectclass: top
objectclass: OblixClass
obready: true
obclasstype: personClass
obclass: oblixPersonPwdPolicy
obclasskind: Auxiliary
obver: 10.1.4.0
----------------------

Import above pwd.ldif to DS containing oblix tree.

=======
Step-2: Configure oblixAuxPerson4LPM in Identity Console (for LPM functionality)
=======
a) goto Identity System Console --> Common Configuration --> Object Classes
* Add auxiliary class oblixauxperson4lpm.
Object Class - oblixauxperson4lpm
Class Attribute - No Class Attribute is specified.
Class Type - Person
Class Kind - Auxiliary

b) goto Identity System Console --> User Manager Configuration --> Tabs --> Employees
* Modify Employees tab to associate auxiliary class oblixauxperson4lpm.

c) goto Identity System Console --> User Manager Configuration --> Tabs --> Employees --> View Object Profile --> Configure Panels
* Configure your default panel or lpm panel to add myChallenge and myResponse attributes to user profile depending upon your customization.

d) goto User Manager --> Configuration --> Attribute Access Control
* Set attribute access to myChallenge and myResponse as desired.

=======
Step-3: Configure oblixPersonPwdPolicy in Identity Console
=======
a) goto Identity System Console --> User Manager Configuration --> Tabs --> Employees
* Modify Employees tab to associate auxiliary class oblixPersonPwdPolicy

=======
Step-4: Setup Password Policy
=======
a) goto Identity System Console --> System Configuration --> Password Policy --> Add
* Create a new password policy as you need.

My test password policy looks like -
Password Policy Name : testpwdpolicy
Password Policy Domain : dc=red,dc=iplanet,dc=com
Password policy filter : Did not specify
Lost Password Policy Name : Did not specify
Password Minimum Length : 3 characters
Minimum Number of Uppercase Characters : 0 characters
Minimum Number of Lowercase Characters : 0 characters
Minimum Number of Nonalphanumeric Characters : 0 characters
Minimum Number of Numeric Characters : 0 characters
Externally specified validation rules : Did not check
Password Validity Period : 4 days
Password Expiry Notice Period : 3 days
Mode of Conveying the Expiry Notice : At Login
Password minimum age : Did not specify
Change on Reset : Enable
Password History : No Password History
Number of login tries allowed : 3
Lockout Duration : 1 Hours
Login tries reset : 2 days
Lost Password Redirect Stylesheet : Defaults
Password Change Redirect Stylesheet : Defaults
Password Expiry Warning Redirect URL : Defaults
Custom Account Lockout Redirect URL : Defaults
Password Policy Enable : Enable

b) Create default URLs for redirects

My test configuration looks like -
Lost Password Redirect URL : http://parrot.red.iplanet.com:8080/identity/oblix/apps/lost_pwd_mgmt/bin/lost_pwd_mgmt.cgi?program=passwordChallengeResponse&login=%userid%&backURL=%HostTarget%%RESOURCE%&target=top
Password Change Redirect URL : http://parrot.red.iplanet.com:8080/identity/oblix/apps/lost_pwd_mgmt/bin/lost_pwd_mgmt.cgi?program=redirectforchangepwd&login=%userid%&backURL=%HostTarget%%RESOURCE%&target=top
Password Expiry Warning Redirect URL : http://parrot.red.iplanet.com:8080/sample/passwordexpiry.html
Custom Account Lockout Redirect URL : http://parrot.red.iplanet.com:8080/sample/accountlockout.html

Log Authentication attempts:
Successful Attempts Attribute : Enable
Failed Attempts Attribute : Enable

=======
Step-5: Enabling access system to use password policy.
=======
By default access server does not use password policy defined through identity system. You had to do oblixPersonPwdPolicy configuration for this. In addition do the following
a) goto Access System Console --> Access System Configuration --> Authentication Management --> Basic Over LDAP --> Plugins --> validate_password
* Modify it as
obCredentialPassword="password",obReadPasswdMode="LDAP",obWritePasswdMode="LDAP"

Note: Make sure there is no typo in the above value. You can copy paste this text to your text editor and make sure there are no special characters or typos. I had to debug for long time because of some special character in this (copy paste error).

=======
Step-6: Configure LPM policy
=======
a) goto Identity System Console --> System Configuration --> Lost Password Policy --> Add
* Create a new password policy as you need.
* Link it with Password Policy setup in Step-4 if you need

=======
Step-7: Restart Identity and Access System
=======

=======
Step-8: Test
=======
* To test Redirect URLs defined in password policy, you need to test a resource protected by access system. If you test your password policy by accessing Identity or Access Console, you will not be redirected.

a) Access a protected resource
http://parrot.red.iplanet.com:8080/sample/test.html

Try authentication failure. Open LDAP browser to data store. You can see that user entry will get updated with lockout and password related information. This means Access System is kicking in password policy. Now test as you wish.

Monday, January 10, 2011

OpenSSO book by QA Manager

Ex-Sun QA manager wrote this OpenSSO book by compiling documentation available in OpenSSO product docs
http://indirat.wordpress.com

Wednesday, June 16, 2010

3 easy Steps to deploy dist auth on AM 7.1

Step-1: Deploy amauthdistui.war that you get with installation or by building it.

Step-2: Copy AMConfig.properties to WEB-INF/classes of web-app directory. File is pasted below. Change it depending upon environment

Step-3: Copy amclientsdk.jar to WEB-INF/lib of web-app directory.

Restart container.

--- Working AMConfig.properties file from my setup ---

/* The following keys are used to configure the Debug service.
* Possible values for the key 'level' are: off | error | warning | message.
* The key 'directory' specifies the output directory where the debug files
* will be created.
* Trailing spaces are significant.
* Windows: Use forward slashes "/" separate directories, not backslash "\".
* Windows: Spaces in the file name are allowed for Windows.
*/
com.iplanet.services.debug.level=error
com.iplanet.services.debug.directory=/var/opt/SUNWam/distauth/debug

/*
* Naming URL
*/
com.iplanet.am.naming.url=http://avatar.red.iplanet.com:80/amserver/namingservice

/*
* Notification URL
*/
com.iplanet.am.notification.url=

/*
* Security Credentials to identify the client to AccessManager and
* used to get the configuration data from AccessManager.
* com.sun.identity.agents.app.username is the name to identitfy
* the application.
* It is recommended that you create an agent identity to identify
* each client in the Access Manager.
* Then, use the agent identity corresponding to the client.
* This would provide better security and provide a better audit trail.
* The default for com.sun.identity.agents.app.username in this file may be
* set as "anonymous" only for ease of use.
*
* com.iplanet.am.service.password is the password corresponding to
* com.sun.identity.agents.app.username.
* Please remember to change this password when you change the value for
* com.sun.identity.agents.app.username
*/
com.sun.identity.agents.app.username=distauth
com.iplanet.am.service.password=password

/*
* Property to set JCE as the default encryption classes
*/
com.iplanet.security.encryptor=com.iplanet.services.util.JCEEncryption

/*
* Cache update time (in minutes) for user management cache,
* if notification URL is not provided
*/
com.iplanet.am.sdk.remote.pollingTime=1

/*
* Cache update time (in minutes) for service configutation data,
* if notification URL is not provided
*/
com.sun.identity.sm.cacheTime=1

/*
* Server protocol, host and port
*/
com.iplanet.am.server.protocol=http
com.iplanet.am.server.host=avatar.red.iplanet.com
com.iplanet.am.server.port=80

/*
* Distributed Authentication Server protocol, host and port
*/
com.iplanet.distAuth.server.protocol=http
com.iplanet.distAuth.server.host=jackal.red.iplanet.com
com.iplanet.distAuth.server.port=7070

com.iplanet.am.cookie.name=iPlanetDirectoryPro
com.iplanet.am.cookie.secure=false
com.iplanet.am.cookie.encode=false

/*
* Distributed Authentication Server deploy URI
*/
com.iplanet.am.services.deploymentDescriptor=/amauthdistui
com.iplanet.am.version=7.1

/*
* Distributed Authentication deploy URI
*/
com.iplanet.am.distauth.deploymentDescriptor=/amauthdistui

/*
* List of comma separated trusted Distributed Authentication servers in cluster
*/
com.sun.identity.distauth.cluster=

/*
* Identify cert db directory path, prefix and password file
* to initialize JSS Socket Factory when Web Container is configured SSL
*/
com.iplanet.am.admin.cli.certdb.dir=CONTAINER_CERTDB_DIR
com.iplanet.am.admin.cli.certdb.prefix=CONTAINER_CERTDB_PREFIX
com.iplanet.am.admin.cli.certdb.passfile=CONFIG_DIR/.wtpass

/*
* Since the notification handler is not registered on Distributed
* authentication side, the following polling parameters need to be specified
* to enable the SessionPoller thread.
*/
com.iplanet.am.session.client.polling.enable=true
com.iplanet.am.session.client.polling.period=180

/*
* Load Balancer cookie name and value to be used when there are multiple
* Distributed authentication web application servers behind Load Balancer.
*/
#com.iplanet.am.lbcookie.name=DistAuthLBCookieName
#com.iplanet.am.lbcookie.value=DistAuthLBCookieValue

com.sun.identity.auth.cookieName=AMDistAuthCookie

Thursday, April 8, 2010

Steps to configure a CDSSO sample in OpenSSO

Deployment example:
------------------
OpenSSO updat1 patch 3 server on machine avatar.red.iplanet.com
Glassfish 3.0 J2EE Policy Agent on machine rub-s10-6.sfbay.sun.com


Step-1: Install OpenSSO server. Configure agent profile, policies.

Step-2: Install J2EE Policy Agent 3.0

Step-3: In container hosting agent, deploy mini agent sample application from http://developers.sun.com/identity/reference/techart/policyagents/agent-mini-app.zip

Step-4: In container hosting agent, deploy agentapp.war This is not installed by default. It is available in the following location:
/opt/lakshman/installations/agents/j2ee_agents/appserver_v9_agent/etc

Step-5: Configure agent profile for 3 properties mentioned in the link:
http://docs.sun.com/app/docs/doc/820-5816/aeabl?a=view
In my sample, the values are (Agent Profile -> SSO tab):
a) Enabled "Cross Domain SSO" checkbox
b) CDSSO Servlet URL: http://avatar.red.iplanet.com:8080/opensso/cdcservlet
c) CDSSO Domain List: .sun.com

Step-6: Set property "CDSSO Clock Skew" if you have not synchronized time between two machines hosting OpenSSO and agent.

Step-7: Add agent machine domain name to Realm/DNS Aliases

Step-8: Restart both containers hosting OpenSSO and glassfish server.

Trouble shooting tips:
----------------------
1. Do not add /agentapp/sunwCDSSORedirectURI to not-enforced-list. This has been discussed some places in a google search.

*************
Related docs:
*************
CDSSO Config
CDSSO Block Diagram
Mini agent sample deployment