OBIEE Online Training

Tuesday, July 10, 2012

Changing User Password in OBIEE 11G


1) OBIEE11g – Changing your password in OBIEE 11G
(Default Authenticator Method)

User Requirement:
Our Users want to Change His or Her Password in Answers/Dashboard with OBIEE 11g

Issue Item:
The Current obiee11.1.1.5.0 version users can’t able change his/her own password.

Workaround Solution Ref:

Note: in obiee10g it’s available but in obiee11g out of box(Oracle recommended external authentication method)
Ref: My Blog:


OBIEE11g Bug Reference:

in OBIEE 10g, Repository Users could change their passwords by exposing a link in the My account page of Answers/Dashboards.

However, in OBIEE 11g, there are no repository Users, so this functionality is not relevant and hence Users need to depend on the functionality of the LDAP to change the passwords.

The following Enhancement Request is logged for addressing this feature in OBIEE 11g.

Bug 11845872 - ABILITY FOR THE END USERS TO CHANGE THEIR PASSWORDS IN OBIEE11G

For more: refer doc:

Change Password Link In Answers/Dashboard Obiee 11g [ID 1302091.1]


Conclusion:

While checking Rittman mead blog, They did some work around with java/J2ee  Bean class then achieved so kindly arrange some one to help me to resolve this J2ee – Bean class (Customized Code deployment and integration with obiee11g)

Java code for changing user password for Default Authenticator:

Hi,


Just use the below java code (Changepwd.java) and compile and run using javatool(JDEV,Netbeans etc)  and get the jar/war file and deploy the war file via Weblogic console then call the link (jmx bean url) in your analysis by using Action link method.
-------------------------------------------------------------------------------
package obiee.chngpwd;


import java.io.IOException;
import java.util.Set;


import javax.management.InstanceNotFoundException;
import javax.management.IntrospectionException;
import javax.management.MBeanException;
import javax.management.MBeanInfo;
import javax.management.MBeanOperationInfo;
import javax.management.MBeanParameterInfo;
import javax.management.MBeanServerConnection;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.ReflectionException;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;


public class Changepwd {
private JMXConnector jmxConnector = null;
private MBeanServerConnection mBeanServerConnection = null;


public Changepwd() throws IOException, MalformedObjectNameException, NullPointerException, InstanceNotFoundException, IntrospectionException, ReflectionException {
JMXServiceURL serviceURL = new JMXServiceURL("service:jmx:rmi://IP/jndi/rmi://IPaddress:1090/jmxconnector");
System.out.println("Connecting to: " + serviceURL);


jmxConnector = JMXConnectorFactory.connect(serviceURL);
mBeanServerConnection = jmxConnector.getMBeanServerConnection();
Set<ObjectName> mbeans = mBeanServerConnection.queryNames(null, null);
for (ObjectName mbeanName : mbeans) {
System.out.println(mbeanName);
System.out.println("Service:" + mbeanName.getKeyPropertyListString() + "Domain:" + mbeanName.getDomain());

}
//ObjectName securityMBeanName = new ObjectName("jboss:service=JNDIView");
//ObjectName securityMBeanName = new ObjectName("jboss:service=JNDIView");
ObjectName securityMBeanName = new ObjectName("Security:Name:myrealmDefaultAuthenticator");
MBeanInfo mbeanInfo = mBeanServerConnection.getMBeanInfo(securityMBeanName);
MBeanOperationInfo[] opInfo = mbeanInfo.getOperations();
        System.out.println("Security Operations: ");
        for(int o = 0; o < opInfo.length; o ++) {
            MBeanOperationInfo op = opInfo[o];


            String returnType = op.getReturnType();
            String opName     = op.getName();
            System.out.print(" + " + returnType + " " + opName + "(");


            MBeanParameterInfo[] params = op.getSignature();
            for(int p = 0; p < params.length; p++)  {
                MBeanParameterInfo paramInfo = params[p];


                String pname = paramInfo.getName();
                String type  = paramInfo.getType();


                if (pname.equals(type)) {
                    System.out.print(type);
                } else {
                    System.out.print(type + " " + securityMBeanName);
                }


                if (p < params.length-1) {
                    System.out.print(','); 
                }
            }
            System.out.println(")");
        }
Object objUser[] = new Object[]{("userId"), ("oldPassword"), ("newPassword") };
//Object objUser[] = new Object[]{("destroy")};
String objStr[] = new String[]{("java.lang.String"), ("java.lang.String"), ("java.lang.String") };
//String objStr[] = new String[]{("java.lang.String")};


try {
//mBeanServerConnection.addNotificationListener(securityMBeanName, new PasswordListener(), null, null);
//Object responseObj = mBeanServerConnection.invoke(securityMBeanName, "jbossInternalLifecycle", objUser, objStr);
Object responseObj = mBeanServerConnection.invoke(securityMBeanName, "changeUserPassword", objUser, objStr);
System.out.println("Response:" + responseObj);




} catch (InstanceNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MBeanException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ReflectionException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
 * @param args
 * @throws IOException 
 * @throws NullPointerException 
 * @throws MalformedObjectNameException 
 * @throws ReflectionException 
 * @throws IntrospectionException 
 * @throws InstanceNotFoundException 
 */
public static void main(String[] args) throws MalformedObjectNameException, NullPointerException, IOException, InstanceNotFoundException, IntrospectionException, ReflectionException {
// TODO Auto-generated method stub
new Changepwd();


}


}


For More about change password info:
http://www.rittmanmead.com/2011/10/changing-your-password-in-obiee-11g/ 


4 comments:

  1. Hi, I tried your code. I am getting "java.io.IOException, Failed to retrieve RMIServer stub: javax.naming.NameNotFoundException: jmxConnector" this error. I tried different things, but failed. Can you please help me resolving this error.
    Thanks in advance.

    ReplyDelete
  2. Hi,
    I am trying to implement the same Java code and encountering the same ERROR:Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
    java.io.EOFException]

    Can you please let me know if I need to make any changes in the code ...
    Regards
    Priya

    ReplyDelete
  3. Did you able to get the issue resolved?

    ReplyDelete
  4. very useful really good information thanks for posting such a good information it will hepls the people a lot keep it up , Regards, obiee training in hyderabad

    ReplyDelete