In attempting to read the user attributes as per:
I get a cast exception. it seems that the local UserProvider is not compatible with the general definition (is not a subclass)
private String determineUserAttribute(HttpServletRequest request, String userName, String attributeName) { String attributeValue = ""; try { InitialContext ctx = new InitialContext(); Object userProvider; userProvider = ctx.lookup("java:comp/env/user/Provider"); UserProvider usrProv = (UserProvider) userProvider; attributeValue = usrProv.getUser(request.getRemoteUser()).getAttribute("firstname"); } catch (UnsupportedUserAttributeException e) { logger.error("UnsupportedUserException", e); } catch (PersistenceException e) { logger.error("PersistenceException", e); } catch (NamingException e) { logger.error("NamingException", e); } return attributeValue; }
any suggestions on how to proceed or what I might be missing?
Using com.sap.security.um.user.UserManagementAccessor I always get a "User Management is not initialized" exception
Is there a requirement to use the Java EE Web runtime?
Thanks,
Chris