Skip to Main Content

Security Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get login of currently logged in user in OIM?

707325Oct 21 2009 — edited Oct 22 2009
Hi,

I am developing JSP in OIM and I would like to obtain data of currently logged in user*, it is possible through getSelfProfile() method ( tcUserOperationsIntf ), so far I have written the following code:

--------------------------------------------------------------------------
tcResultSet loggedUser = null;
tcUtilityFactory utilityFactory = null;
ConfigurationClient.ComplexSetting myConfig =
ConfigurationClient.getComplexSettingByPath("Discovery.CoreServer");
final Hashtable env = myConfig.getAllSettings();

tcSignatureMessage moSignature = tcCryptoUtil.sign("xelsysadm", "PrivateKey");
utilityFactory = new tcUtilityFactory(env, moSignature);

tcUserOperationsIntf userIntf;
userIntf = (tcUserOperationsIntf)utilityFactory.getUtility("Thor.API.Operations.tcUserOperationsIntf");
loggedUser = userIntf.getSelfProfile();


String userLogin;

try
{
userLogin = loggedUser.getStringValue("Users.User ID");
System.out.println("User = "+userLogin);
}
catch (tcColumnNotFoundException e)
{
// TODO
}
--------------------------------------------------------------------------

The problem that this code always returns XELSYSADM, and NOT data for user who is really currently logged in. I think that this is because of the one line on code (marked as bold) where xelsysadm is passed to the moSignature variable. But without this line of code it is impossible (I think so...) to initialize tcUserOperationsIntf and use the getSelfProfile() method... and the circle is closed...

Had anyone similar scenario?

Thanks in advance!
This post has been answered by SagarChoudhary on Oct 21 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 19 2009
Added on Oct 21 2009
5 comments
1,903 views