Examples of ISecurityContext


Examples of org.jasig.portal.security.ISecurityContext

        try {
            // Get the person object associated with the request
            person = this.personManager.getPerson(request);
            if (person != null) {
                // Retrieve the security context for the user
                final ISecurityContext securityContext = person.getSecurityContext();
                if (securityContext.isAuthenticated()) {
                    if (log.isDebugEnabled()) {
                        log.debug("LogoutController::getRedirectionUrl()"
                                + " Looking for redirect string for the root context");
                    }
                    redirect = this.redirectMap.get("root");
                    if (redirect != null && !redirect.equals("")) {
                        return redirect;
                    }
                }
                final Enumeration subCtxNames = securityContext.getSubContextNames();
                while (subCtxNames.hasMoreElements()) {
                    final String subCtxName = (String) subCtxNames.nextElement();
                    if (log.isDebugEnabled()) {
                        log.debug("LogoutController::getRedirectionUrl() " + " subCtxName = " + subCtxName);
                    }
                    // strip off "root." part of name
                    final ISecurityContext sc = securityContext.getSubContext(subCtxName);
                    if (log.isDebugEnabled()) {
                        log.debug("LogoutController::getRedirectionUrl()" + " subCtxName isAuth = " + sc.isAuthenticated());
                    }
                    if (sc.isAuthenticated()) {
                        if (log.isDebugEnabled()) {
                            log.debug("LogoutController::getRedirectionUrl()"
                                    + " Looking for redirect string for subCtxName = " + subCtxName);
                        }
                        redirect = this.redirectMap.get(subCtxName);
View Full Code Here

Examples of org.jasig.portal.security.ISecurityContext

     * @exception PortalSecurityException
     */
    public void authenticate(HttpServletRequest request, Map<String, String> principals, Map<String, String> credentials, IPerson person) throws PortalSecurityException {

        // Retrieve the security context for the user
        final ISecurityContext securityContext = person.getSecurityContext();

        //Set the principals and credentials for the security context chain
        this.configureSecurityContextChain(principals, credentials, person, securityContext, BASE_CONTEXT_NAME);

        // NOTE: PortalPreAuthenticatedProcessingFilter looks in the security.properties file to
        // determine what tokens to look for that represent the principals and
        // credentials for each context. It then retrieves the values from the request
        // and stores the values in the principals and credentials HashMaps that are
        // passed to the Authentication service.

        // Attempt to authenticate the user
        final long start = System.currentTimeMillis();
        securityContext.authenticate();
        final long elapsed = System.currentTimeMillis() - start;
        // Check to see if the user was authenticated
        if (securityContext.isAuthenticated()) {
            lastAuthentication = authenticationTimes.add(elapsed); // metric
            // Add the authenticated username to the person object
            // the login name may have been provided or reset by the security provider
            // so this needs to be done after authentication.
            final String userName = securityContext.getPrincipal().getUID();
            person.setAttribute(IPerson.USERNAME, userName);
           
            threadNamingRequestFilter.updateCurrentUsername(userName);
           
            //Clear all existing group data about the person
View Full Code Here

Examples of org.jasig.portal.security.ISecurityContext

            String localSubCtxName = fullSubCtxName;
            if (fullSubCtxName.startsWith(baseContextName + ".")) {
                localSubCtxName = localSubCtxName.substring(baseContextName.length() + 1);
            }

            final ISecurityContext sc = securityContext.getSubContext(localSubCtxName);

            this.configureSecurityContextChain(principals, credentials, person, sc, fullSubCtxName);
        }
    }
View Full Code Here

Examples of org.jasig.portal.security.ISecurityContext

    }
   
    // get the CasSecurityContext
        final IUserInstance userInstance = userInstanceManager.getUserInstance(httpServletRequest);
        final IPerson person = userInstance.getPerson();
    final ISecurityContext context = person.getSecurityContext();
    if (context == null) {
      log.error("no security context, no proxy ticket passed to the portlet");
      return null;
    }
    ISecurityContext casContext = getCasContext(context);
    if (casContext == null) {
      log.debug("no CAS security context, no proxy ticket passed to the portlet");
      return null;
    }
    if (!casContext.isAuthenticated()) {
      log.debug("no CAS authentication, no proxy ticket passed to the portlet");
      return null;
    }
   
    // get a proxy ticket for our portlet from the CasSecurityContext
View Full Code Here

Examples of org.jasig.portal.security.ISecurityContext

    if (context instanceof ICasSecurityContext) {
      return context;
    }
    Enumeration contextEnum = context.getSubContexts();
    while (contextEnum.hasMoreElements()) {
      ISecurityContext subContext = (ISecurityContext) contextEnum.nextElement();
      if (subContext instanceof ICasSecurityContext) {
        return subContext;
      }
    }
    return null;
View Full Code Here

Examples of org.jasig.portal.security.ISecurityContext

        final IPerson person = this.personManager.getPerson((HttpServletRequest) request);
        if (person == null) {
            return true;
        }
       
        final ISecurityContext securityContext = person.getSecurityContext();
        if (securityContext != null && securityContext.isAuthenticated()) {
            // We have an authenticated user... let's see if any MAX_INACTIVE settings apply...
            IAuthorizationPrincipal principal = authorizationService.newPrincipal((String) person.getAttribute(IPerson.USERNAME), IPerson.class);
            Integer rulingGrant = null;
            Integer rulingDeny = null;
            IPermission[] permissions = authorizationService.getAllPermissionsForPrincipal(principal, null, "MAX_INACTIVE", null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.