Examples of SecurityContext


Examples of org.apache.cxf.security.SecurityContext

        ServletContext servletContext =
            (ServletContext)request.getAttribute(WebServiceContainer.SERVLET_CONTEXT);
        message.put(MessageContext.SERVLET_CONTEXT, servletContext);
       
        if (this.passSecurityContext) {
            message.put(SecurityContext.class, new SecurityContext() {
                public Principal getUserPrincipal() {
                    return servletRequest.getUserPrincipal();
                }
                public boolean isUserInRole(String role) {
                    return servletRequest.isUserInRole(role);
View Full Code Here

Examples of org.apache.cxf.security.SecurityContext

   
    /**
     * Get the Issuer of the SAML Assertion
     */
    private String getIssuer(Message message) throws WSSecurityException {
        SecurityContext sc = message.get(SecurityContext.class);
       
        if (sc instanceof SAMLSecurityContext) {
            Element assertionElement = ((SAMLSecurityContext)sc).getAssertionElement();
            if (assertionElement != null) {
                AssertionWrapper wrapper = new AssertionWrapper(assertionElement);
View Full Code Here

Examples of org.apache.tuscany.sca.host.http.SecurityContext

        if (!servletMapping.endsWith("*")) {
            servletMapping += "*";
        }
       

        SecurityContext securityContext = new SecurityContext();
        boolean isConfidentialityRequired = false;
        boolean isAuthenticationRequired = false;
       
       
        // find out which policies are active
        if (binding instanceof PolicySetAttachPoint) {
            List<Intent> intents = ((PolicySetAttachPoint)binding).getRequiredIntents();
            for(Intent intent : intents) {
                if (intent.getName().equals(AUTEHTICATION_INTENT)) {
                    isAuthenticationRequired = true;
                } else if (intent.getName().equals(CONFIDENTIALITY_INTENT)) {
                    isConfidentialityRequired = true;
                }
            }
           
            List<PolicySet> policySets = ((PolicySetAttachPoint)binding).getApplicablePolicySets();
            for (PolicySet ps : policySets) {
                for (Object p : ps.getPolicies()) {
                    if (ConfidentialityPolicy.class.isInstance(p) && isConfidentialityRequired) {
                        //Handle enabling and configuring SSL
                        ConfidentialityPolicy confidentialityPolicy = (ConfidentialityPolicy)p;                       
                       
                        securityContext.setSSLEnabled(true);
                        securityContext.setSSLProperties(confidentialityPolicy.toProperties());
                    } else if(AuthenticationConfigurationPolicy.class.isInstance(p) && isAuthenticationRequired) {
                        // Handle authentication and user configuration
                        AuthenticationConfigurationPolicy authenticationConfiguration = (AuthenticationConfigurationPolicy)p;
                       
                        securityContext.setAuthenticationEnabled(true);
                        securityContext.getUsers().clear();
                        securityContext.getUsers().addAll(authenticationConfiguration.getUsers());
                    }
                }
            }
        }       
       
View Full Code Here

Examples of org.beangle.security.core.context.SecurityContext

      return;
    }

    HttpSession httpSession = safeGetSession(request, forceEagerSessionCreation);
    boolean httpSessionExistedAtStartOfRequest = httpSession != null;
    SecurityContext contextBeforeChainExecution = readSecurityContextFromSession(httpSession);

    // Make the HttpSession null, as we don't want to keep a reference to it
    // lying
    // around in case chain.doFilter() invalidates it.
    httpSession = null;

    if (contextBeforeChainExecution == null) {
      contextBeforeChainExecution = generateNewContext();
      logger.debug("New SecurityContext instance will be associated with SecurityContextHolder");
    } else {
      logger.debug("Obtained a valid SecurityContext from Beangle_SECURITY_CONTEXT to "
          + "associate with SecurityContextHolder: '{}'", contextBeforeChainExecution);
    }

    int contextHashBeforeChainExecution = contextBeforeChainExecution.hashCode();
    request.setAttribute(FILTER_APPLIED, Boolean.TRUE);

    // Create a wrapper that will eagerly update the session with the
    // security context
    // if anything in the chain does a sendError() or sendRedirect().
    // See SEC-398
    OnRedirectUpdateSessionResponseWrapper responseWrapper = new OnRedirectUpdateSessionResponseWrapper(
        response, request, httpSessionExistedAtStartOfRequest, contextHashBeforeChainExecution);
    // Proceed with chain
    try {
      // This is the only place in this class where
      // SecurityContextHolder.setContext() is called
      SecurityContextHolder.setContext(contextBeforeChainExecution);

      chain.doFilter(request, responseWrapper);
    } finally {
      // This is the only place in this class where
      // SecurityContextHolder.getContext() is called
      SecurityContext contextAfterChainExecution = SecurityContextHolder.getContext();

      // Crucial removal of SecurityContextHolder contents - do this
      // before anything else.
      SecurityContextHolder.clearContext();
View Full Code Here

Examples of org.gatein.pc.api.spi.SecurityContext

      markupRequest = createMarkupRequestFrom(markupTypes, params, portlet);

      // prepare information for invocation
      final org.oasis.wsrp.v2.UserContext wsrpUserContext = getUserContext();
      checkUserContext(wsrpUserContext);
      SecurityContext securityContext = createSecurityContext(params, runtimeContext, wsrpUserContext);
      final MediaType mediaType = createMediaType(markupRequest);
      PortalContext portalContext = createPortalContext(params, markupRequest);
      UserContext userContext = createUserContext(wsrpUserContext, markupRequest.getLocale(), desiredLocales);
      String portletInstanceKey = runtimeContext.getPortletInstanceKey();
      instanceContext = createInstanceContext(portletContext, getAccessMode(), portletInstanceKey);
View Full Code Here

Examples of org.italiangrid.utils.voms.SecurityContext

     * @return the {@link CurrentAdmin} object representing the currently active
     *         administrator
     */
    public static CurrentAdmin instance() {

        SecurityContext theContext = SecurityContextImpl.getCurrentContext();

        String rfcReadableString = X500NameUtils.getReadableForm(theContext.getClientX500Principal());
        String adminDN = OpensslNameUtils.convertFromRfc2253(rfcReadableString, false);

        X509Principal papAdmin = PAPAdminFactory.getDn( adminDN );

        if ( papAdmin == null )
View Full Code Here

Examples of org.jboss.ballroom.client.rbac.SecurityContext

    }

    @Override
    public Set<String> getReadOnlyNames() {
        SecurityService securityFacilities = framework.getSecurityService();
        SecurityContext securityContext = securityFacilities.getSecurityContext();

        if(resourceAddress !=null)
        {
            return securityFacilities.getReadOnlyJavaNames(conversionType, resourceAddress, securityContext);
        }
View Full Code Here

Examples of org.jboss.dna.graph.SecurityContext

            }
        };

        repository = new JcrRepository(context, connectionFactory, "unused");

        SecurityContext mockSecurityContext = new MockSecurityContext("testuser",
                                                                      Collections.singleton(JcrSession.DNA_WRITE_PERMISSION));
        session = (JcrSession)repository.login(new SecurityContextCredentials(mockSecurityContext));
    }
View Full Code Here

Examples of org.jboss.errai.security.client.local.api.SecurityContext

  }

  @Override
  public void observeEvent(final LifecycleEvent<W> event) {
    // There is no good way to inject the context within the bootstrapper.
    final SecurityContext securityContext = SecurityContextHoldingSingleton.getSecurityContext();
    final Set<Role> roles = roleExtractor.extractAllRoles(annotation);
   
    if (!securityContext.isUserCacheValid() || !securityContext.hasCachedUser()
            || !securityContext.getCachedUser().getRoles().containsAll(roles)) {
      event.veto();

      if (!securityContext.hasCachedUser())
        securityContext.redirectToLoginPage(event.getInstance().getClass());
      else
        securityContext.redirectToSecurityErrorPage(event.getInstance().getClass());
    }
  }
View Full Code Here

Examples of org.jboss.portal.portlet.spi.SecurityContext

   public PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException
   {
      PortletContainer container = (PortletContainer)invocation.getAttribute(ContainerPortletInvoker.PORTLET_CONTAINER);
      PortletInfo containerInfo = container.getInfo();
      SecurityInfo securityInfo = containerInfo.getSecurity();
      SecurityContext securityContext = invocation.getSecurityContext();
      boolean invoke = true;
      if (!securityContext.isSecure())
      {
         if (securityInfo.containsTransportGuarantee(TransportGuarantee.CONFIDENTIAL))
         {
            invoke = false;
         }
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.