use of com.sun.identity.console.base.AuthenticatedViewBean in project OpenAM by OpenRock.
the class EndUserViewBean method forwardTo.
public void forwardTo(RequestContext rc) {
String userId = (String) getPageSessionAttribute(UNIVERSAL_ID);
if (userId == null) {
EntitiesModel model = (EntitiesModel) getModel();
try {
userId = model.getUserName();
AMIdentity amid = IdUtils.getIdentity(model.getUserSSOToken(), userId);
setPageSessionAttribute(UNIVERSAL_ID, userId);
setPageSessionAttribute(EntityOpViewBeanBase.ENTITY_NAME, amid.getName());
setPageSessionAttribute(EntityOpViewBeanBase.ENTITY_TYPE, amid.getType().getName());
Set agentTypes = amid.getAttribute("AgentType");
if ((agentTypes != null) && !agentTypes.isEmpty()) {
setPageSessionAttribute(EntityOpViewBeanBase.ENTITY_AGENT_TYPE, (String) agentTypes.iterator().next());
}
super.forwardTo(rc);
} catch (IdRepoException e) {
AuthenticatedViewBean vb = (AuthenticatedViewBean) getViewBean(AuthenticatedViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(rc);
} catch (SSOException e) {
AuthenticatedViewBean vb = (AuthenticatedViewBean) getViewBean(AuthenticatedViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(rc);
}
} else {
super.forwardTo(rc);
}
}
Aggregations