Examples of SecurityContext


Examples of org.jboss.test.security.interfaces.SecurityContext

      log.debug("+++ testDomainInteraction()");
      Object obj = getInitialContext().lookup("spec.UserInRoleContextSession");
      obj = PortableRemoteObject.narrow(obj, SecurityContextHome.class);
      SecurityContextHome home = (SecurityContextHome) obj;
      log.debug("Found UserInRoleContextSession");
      SecurityContext bean = home.create();
      log.debug("Created spec.UserInRoleContextSession");
      HashSet roles = new HashSet();
      roles.add("Role1");
      roles.add("Role2");
      bean.testDomainInteraction(roles);
      bean.remove();
   }
View Full Code Here

Examples of org.jrest4guice.security.SecurityContext

      RestContextManager.setContext(requestWrapper, hResponse, params);
      SNASessionProvider.setCurrentSNASession(snaSession);

      // 检测用户当前的安全状态
      if (requestWrapper.getUserPrincipal() != null) {
        SecurityContext securityContext = GuiceContext.getInstance()
            .getBean(SecurityContext.class);
        GuiceContext.getInstance().injectorMembers(securityContext);
        securityContext.getUserPrincipal();
      }

      // 处理当前请求
      new JRest4GuiceProcessor().setUrlPrefix(this.urlPrefix).process(
          requestWrapper, hResponse);
View Full Code Here

Examples of org.modeshape.jcr.security.SecurityContext

        }

        // We have successfully authenticated ...
        try {
            // Look for whether this context is read-only ...
            SecurityContext securityContext = sessionContext.getSecurityContext();
            boolean writable = JcrSession.hasRole(securityContext, ModeShapeRoles.READWRITE, repoName, workspaceName)
                               || JcrSession.hasRole(securityContext, ModeShapeRoles.ADMIN, repoName, workspaceName);
            JcrSession session = null;
            if (running.useXaSessions()) {
                session = new JcrXaSession(this, workspaceName, sessionContext, attributes, !writable);
View Full Code Here

Examples of org.mule.api.security.SecurityContext

        if (logger.isDebugEnabled())
        {
            logger.debug("Authentication success: " + authentication.toString());
        }

        SecurityContext context = getSecurityManager().createSecurityContext(authentication);
        context.setAuthentication(authentication);
        event.getSession().setSecurityContext(context);
    }
View Full Code Here

Examples of org.ow2.easybeans.security.propagation.context.SecurityContext

            final boolean runAsMode) {
        super(source, EventBeanInvocationBegin.nextNumber++);
        this.arguments = arguments;
        this.securityContext = securityContext;
        if (securityContext == null) {
            this.securityContext = new SecurityContext();
        }

        this.runAsMode = runAsMode;
    }
View Full Code Here

Examples of org.ow2.easybeans.security.propagation.context.SecurityContext

     * Send reply with context to the client.
     * @param jServerRequestInfo the jrmp server request information
     * @exception IOException if an exception occur with the ObjectOutput
     */
    public void send_reply(final JServerRequestInfo jServerRequestInfo) throws IOException {
        SecurityCurrent.getCurrent().setSecurityContext(new SecurityContext());
    }
View Full Code Here

Examples of org.ow2.easybeans.security.propagation.context.SecurityContext

        // Gets the current
        EZBSecurityCurrent current = SecurityCurrent.getCurrent();

        // Build a new security context
        EZBSecurityContext context = new SecurityContext(this.subject);

        // Set it globally or in the current thread
        if (this.globalContext) {
            SecurityCurrent.setGlobalSecurityContext(context);
        } else {
View Full Code Here

Examples of org.ow2.easybeans.security.propagation.context.SecurityContext

     * @throws LoginException if the logout fails
     */
    public boolean logout() throws LoginException {

        // Build a new anonymous context
        SecurityContext context = new SecurityContext(SecurityContext.ANONYMOUS_SUBJECT);

        // Gets the current
        EZBSecurityCurrent current = SecurityCurrent.getCurrent();

        // Set it globally or in the current thread
View Full Code Here

Examples of org.springframework.security.context.SecurityContext

                username,
                new GrantedAuthority[] {
                        new GrantedAuthorityImpl("ROLE_TELLER"),
                        new GrantedAuthorityImpl("ROLE_PERMISSION_LIST") });

        SecurityContext secureContext = new SecurityContextImpl();
        secureContext.setAuthentication(auth);
        SecurityContextHolder.setContext(secureContext);

    }
View Full Code Here

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

    public void setAuthenticatedUser(String userId) {
        final User user = userRepository.get(userId);
        if (user == null) {
            throw new UsernameNotFoundException("User with id '" + userId + "' was not found!");
        }
        SecurityContext securityContext = createContext(user);
        SecurityContextHolder.setContext(securityContext);
    }
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.