Package org.exoplatform.web.security

Examples of org.exoplatform.web.security.GateInToken


      {
         throw new NullPointerException();
      }
      String tokenId = nextTokenId();
      long expirationTimeMillis = System.currentTimeMillis() + validityMillis;
      tokens.put(tokenId, new GateInToken(expirationTimeMillis, credentials));
      return tokenId;
   }
View Full Code Here


   }

   @Override
   public GateInToken deleteToken(String id)
   {
      GateInToken token = tokens.get(id);
      tokens.remove(id);
      return token;
   }
View Full Code Here

   {
      Map<String, TokenEntry> tokens = getTokens();
      TokenEntry entry = tokens.get(tokenId);
      if (entry != null)
      {
         GateInToken token = entry.getToken();
         entry.remove();
         return token;
      }
      else
      {
View Full Code Here

   @Destroy
   public abstract void remove();

   public GateInToken getToken()
   {
      return new GateInToken(
         getExpirationTime().getTime(),
         new Credentials(getUserName(), getPassword()));
   }
View Full Code Here

         @Override
         protected String execute()
         {
            String tokenId = nextTokenId();
            long expirationTimeMillis = System.currentTimeMillis() + validityMillis;
            GateInToken token = new GateInToken(expirationTimeMillis, credentials);
            TokenContainer container = getTokenContainer();
            container.saveToken(tokenId, token.getPayload(), new Date(token.getExpirationTimeMillis()));
            return tokenId;
         }
      }.executeWith(chromatticLifeCycle);
   }
View Full Code Here

            UIPortal uiPortal = event.getSource();
            RemindPasswordTokenService tokenService = uiPortal.getApplicationComponent(RemindPasswordTokenService.class);
            String tokenId = event.getRequestContext().getRequestParameter("tokenId");

            WebuiRequestContext requestContext = event.getRequestContext();
            GateInToken token = tokenService.getToken(tokenId);
            if (token == null) {
                requestContext.getUIApplication().addMessage(new ApplicationMessage("UIForgetPassword.msg.expration", null));
                requestContext.addUIComponentToUpdateByAjax(uiPortal.getParent());
                return;
            }

            OrganizationService orgSrc = uiPortal.getApplicationComponent(OrganizationService.class);
            // get user
            User user = orgSrc.getUserHandler().findUserByName(token.getPayload().getUsername());
            if (user == null) {
                requestContext.getUIApplication().addMessage(new ApplicationMessage("UIForgetPassword.msg.user-delete", null));
                return;
            }
View Full Code Here

            UIPortal uiPortal = event.getSource();
            RemindPasswordTokenService tokenService = uiPortal.getApplicationComponent(RemindPasswordTokenService.class);
            String tokenId = event.getRequestContext().getRequestParameter("tokenId");

            WebuiRequestContext requestContext = event.getRequestContext();
            GateInToken token = tokenService.getToken(tokenId);
            if (token == null) {
                requestContext.getUIApplication().addMessage(new ApplicationMessage("UIForgetPassword.msg.expration", null));
                requestContext.addUIComponentToUpdateByAjax(uiPortal.getParent());
                return;
            }

            OrganizationService orgSrc = uiPortal.getApplicationComponent(OrganizationService.class);
            // get user
            User user = orgSrc.getUserHandler().findUserByName(token.getPayload().getUsername());
            if (user == null) {
                requestContext.getUIApplication().addMessage(new ApplicationMessage("UIForgetPassword.msg.user-delete", null));
                return;
            }
View Full Code Here

      {
         UIPortal uiPortal = event.getSource();
         RemindPasswordTokenService tokenService = uiPortal.getApplicationComponent(RemindPasswordTokenService.class);
         String tokenId = event.getRequestContext().getRequestParameter("tokenId");

         GateInToken token = tokenService.getToken(tokenId);
         if (token == null)
         {
            WebuiRequestContext requestContext = event.getRequestContext();
            requestContext.getUIApplication()
               .addMessage(new ApplicationMessage("UIForgetPassword.msg.expration", null));
            requestContext.addUIComponentToUpdateByAjax(uiPortal.getParent());
            return;
         }

         UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
         UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);

         OrganizationService orgSrc = uiPortal.getApplicationComponent(OrganizationService.class);
         // get user
         User user = orgSrc.getUserHandler().findUserByName(token.getPayload().getUsername());

         UIResetPassword uiReset = uiMaskWS.createUIComponent(UIResetPassword.class, null, null);
         uiReset.setUser(user);
         uiReset.setTokenId(tokenId);
         uiMaskWS.setUIComponent(uiReset);
View Full Code Here

            UIPortal uiPortal = event.getSource();
            RemindPasswordTokenService tokenService = uiPortal.getApplicationComponent(RemindPasswordTokenService.class);
            String tokenId = event.getRequestContext().getRequestParameter("tokenId");

            WebuiRequestContext requestContext = event.getRequestContext();
            GateInToken token = tokenService.getToken(tokenId);
            if (token == null) {
                requestContext.getUIApplication().addMessage(new ApplicationMessage("UIForgetPassword.msg.expration", null));
                requestContext.addUIComponentToUpdateByAjax(uiPortal.getParent());
                return;
            }

            OrganizationService orgSrc = uiPortal.getApplicationComponent(OrganizationService.class);
            // get user
            User user = orgSrc.getUserHandler().findUserByName(token.getPayload().getUsername());
            if (user == null) {
                requestContext.getUIApplication().addMessage(new ApplicationMessage("UIForgetPassword.msg.user-delete", null));
                return;
            }
View Full Code Here

            UIPortal uiPortal = event.getSource();
            RemindPasswordTokenService tokenService = uiPortal.getApplicationComponent(RemindPasswordTokenService.class);
            String tokenId = event.getRequestContext().getRequestParameter("tokenId");

            WebuiRequestContext requestContext = event.getRequestContext();
            GateInToken token = tokenService.getToken(tokenId);
            if (token == null) {
                requestContext.getUIApplication().addMessage(new ApplicationMessage("UIForgetPassword.msg.expration", null));
                requestContext.addUIComponentToUpdateByAjax(uiPortal.getParent());
                return;
            }

            OrganizationService orgSrc = uiPortal.getApplicationComponent(OrganizationService.class);
            // get user
            User user = orgSrc.getUserHandler().findUserByName(token.getPayload().getUsername(), UserStatus.ANY);
            if (user == null) {
                requestContext.getUIApplication().addMessage(new ApplicationMessage("UIForgetPassword.msg.user-delete", null));
                return;
            } else if (!user.isEnabled()) {
                requestContext.getUIApplication().addMessage(new ApplicationMessage("UIForgetPassword.msg.user-is-disabled", null));
View Full Code Here

TOP

Related Classes of org.exoplatform.web.security.GateInToken

Copyright © 2018 www.massapicom. 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.