Search in sources :

Example 1 with AuthenticatedViewBean

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);
    }
}
Also used : AuthenticatedViewBean(com.sun.identity.console.base.AuthenticatedViewBean) Set(java.util.Set) AMIdentity(com.sun.identity.idm.AMIdentity) IdRepoException(com.sun.identity.idm.IdRepoException) SSOException(com.iplanet.sso.SSOException) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Aggregations

SSOException (com.iplanet.sso.SSOException)1 AuthenticatedViewBean (com.sun.identity.console.base.AuthenticatedViewBean)1 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)1 AMIdentity (com.sun.identity.idm.AMIdentity)1 IdRepoException (com.sun.identity.idm.IdRepoException)1 Set (java.util.Set)1