Thursday, May 6, 2010

User principal is not propagated to Middle tier. New bug on 11.1.1.3. (Fixed in 11.1.1.4)

It may be strange that a new bug like that is introduced in a bug fixing release but it can happen to the best also.

After Migrating to jdeveloper 11.1.1.3.0 you will notice that application module method getUserPrincipalName() return always ‘Anonymous’ and history columns for user are populated with null. Andrejus Baranovskis have posted about it, Steve Muench logged on Oracle Metalink - bug# 9672139 and a workaround is posted also in the comments that we also use and seams to solve the problem.
I post it also to follow upe with it.
On our base Application Module class we override the prepare session and:

@Override
protected void prepareSession(Session session) {
String contextUser = ADFContext.getCurrent().getSecurityContext().getUserName();
String envUser = (String)session.getEnvironment().get(PropertyMetadata.USER_PRINCIPAL.getName());
if (!envUser.equals(contextUser)) {
session.getEnvironment().put(PropertyMetadata.USER_PRINCIPAL.getName(),contextUser);
}

super.prepareSession(session);
}

No comments:

Post a Comment