Examples of UserContext


Examples of oasis.names.tc.wsrp.v1.types.UserContext

        return runtimeContext;
    }

    protected UserContext getUserContext(String userID) {
        UserContext userContext = null;

        if (userID != null) {
            User user = consumerEnv.getUserRegistry().getUser(userID);

            if (user != null) {
                userContext = user.getUserContext();
            }
        }
       
        // workaround for Oracle bug, always send a userContext with dummy value
        // if none was provided
       
        if (userContext == null) {
          userContext = new UserContext();
          userContext.setUserContextKey("dummyUserContextKey");
        }

        return userContext;
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.security.user.UserContext

        return root.getLocation(path);
    }

    UserManager getUserManager() throws UnsupportedRepositoryOperationException {
        // FIXME
        UserContext ctx = new UserContextImpl();
        return TODO.unimplemented().returnValue(new UserManagerImpl(getSession(), getNamePathMapper(), ctx.getUserProvider(contentSession, root), ctx.getMembershipProvider(contentSession, root), ctx.getConfig()));
    }
View Full Code Here

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

        while (true) {
            switch (event) {
                case START_ELEMENT:
                    name = reader.getName();
                    if(USER_QNAME.equals(name)) {
                        UserContext user = new UserContext();
                        //<tuscany:user username="user1" password="tuscany" roles="admin, user"/>
                        String username = reader.getAttributeValue(null, "username");
                        if(username == null) {
                            error("RequiredAttributeUsernameMissing", reader);
                        } else {
                            user.setUsername(username);   
                        }
                       
                        String password = reader.getAttributeValue(null, "password");
                        if(password == null) {
                            error("RequiredAttributePasswordMissing", reader);
                        } else {
                            user.setPassword(password);
                        }
                       
                        String roles = reader.getAttributeValue(null, "roles");
                        if(roles == null) {
                            error("RequiredAttributeRolesMissing", reader);
                        } else {
                            for (StringTokenizer tokens = new StringTokenizer(roles, ","); tokens.hasMoreTokens();) {
                                user.getRoles().add(tokens.nextToken());   
                            }
                        }
                       
                        authenticationConfiguration.getUsers().add(user);
                    }
View Full Code Here

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

      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);
      WindowContext windowContext = createWindowContext(portletContext.getId(), runtimeContext);

      // prepare the invocation context
View Full Code Here

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

      if ((invocation instanceof ActionInvocation || invocation instanceof EventInvocation) && oldContext.getAccessMode() == AccessMode.READ_ONLY)
      {
         PortletContext oldTarget = invocation.getTarget();
         try
         {
            UserContext userContext = invocation.getUserContext();
            PortletInstanceContext newContext = new PortletInstanceContext(userContext, oldTarget);

            //
            invocation.setInstanceContext(newContext);
            invocation.setTarget(newContext.getTarget());
View Full Code Here

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

      {
         return null; // the user context is most likely in the session already
      }

      // todo: deal with user categories and user context key properly
      UserContext userContext = invocation.getUserContext();
      if (userContext != null)
      {
         String userContextKey = getUserContextKeyFor(userContext);
         if (userContextKey == null)
         {
View Full Code Here

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

      PropertyContext prefs = (PropertyContext)invocation.getAttribute(PropertyContext.PREFERENCES_ATTRIBUTE);
      PreferencesValidator validator = container.getPreferencesValidator();
      ContainerPortletInfo info = container.getInfo();
      ContainerPreferencesInfo containerPrefs = info.getPreferences();
      ContainerNavigationInfo navigationInfo = info.getNavigation();
      UserContext userContext = invocation.getUserContext();
      HttpServletRequestWrapper realReq = new HttpServletRequestWrapper(invocation.getDispatchedRequest());

      //
      PortletRequestAttributes attributes = new PortletRequestAttributes(invocation.getSecurityContext(), container, userContext, realReq);
      if (invocation.getRequestAttributes() != null)
View Full Code Here

Examples of org.glyptodon.guacamole.net.auth.UserContext

        try {

            // Obtain context from session
            HttpSession httpSession = request.getSession(true);
            UserContext context = getUserContext(httpSession);

            // If new credentials present, update/create context
            if (hasNewCredentials(request)) {

                // Retrieve username and password from parms
                String username = request.getParameter("username");
                String password = request.getParameter("password");

                // If no username/password given, try Authorization header
                if (useHttpAuthentication && username == null && password == null) {

                    String authorization = request.getHeader("Authorization");
                    if (authorization != null && authorization.startsWith("Basic ")) {

                        // Decode base64 authorization
                        String basicBase64 = authorization.substring(6);
                        String basicCredentials = new String(DatatypeConverter.parseBase64Binary(basicBase64), "UTF-8");

                        // Pull username/password from auth data
                        int colon = basicCredentials.indexOf(':');
                        if (colon != -1) {
                            username = basicCredentials.substring(0, colon);
                            password = basicCredentials.substring(colon+1);
                        }

                        else
                            logger.info("Invalid HTTP Basic \"Authorization\" header received.");

                    }

                } // end Authorization header fallback
               
                // Build credentials object
                Credentials credentials = new Credentials();
                credentials.setSession(httpSession);
                credentials.setRequest(request);
                credentials.setUsername(username);
                credentials.setPassword(password);

                SessionListenerCollection listeners = new SessionListenerCollection(httpSession);

                // If no cached context, attempt to get new context
                if (context == null) {

                    context = authProvider.getUserContext(credentials);

                    // Log successful authentication
                    if (context != null && logger.isInfoEnabled())
                        logger.info("User \"{}\" successfully authenticated from {}.",
                                context.self().getUsername(), getLoggableAddress(request));
                   
                }

                // Otherwise, update existing context
                else
View Full Code Here

Examples of org.glyptodon.guacamole.net.auth.UserContext

     
        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) resp;

        // Pull user context from session
        UserContext context = null;
        HttpSession session = request.getSession(false);
        if (session != null)
            context = AuthenticatingFilter.getUserContext(session);

        // If authenticated, proceed with rest of chain
View Full Code Here

Examples of org.glyptodon.guacamole.net.auth.UserContext

        try {

            // Obtain context from session
            HttpSession httpSession = request.getSession(true);
            UserContext context = AuthenticatingFilter.getUserContext(httpSession);

            // If no context, no authorizaton present
            if (context == null)
                throw new GuacamoleUnauthorizedException("Not authenticated");
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.