Examples of GateInToken


Examples of org.exoplatform.web.security.GateInToken

            if (en != null) {
                HashedToken hashedToken = getMixin(en, HashedToken.class);
                if (hashedToken != null && hashedToken.getHashedToken() != null) {
                    try {
                        if (saltedHashService.validate(token.getRandomString(), hashedToken.getHashedToken())) {
                            GateInToken encryptedToken = en.getToken();
                            Credentials encryptedCredentials = encryptedToken.getPayload();
                            Credentials decryptedCredentials = new Credentials(encryptedCredentials.getUsername(),

                            codec.decode(encryptedCredentials.getPassword()));
                            if (remove) {
                                en.remove();
                            }
                            return new GateInToken(encryptedToken.getExpirationTimeMillis(), decryptedCredentials);
                        }
                    } catch (SaltedHashException e) {
                        log.warn("Could not validate cookie token against its salted hash.", e);
                    }
                }
View Full Code Here

Examples of org.exoplatform.web.security.GateInToken

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

Examples of org.exoplatform.web.security.GateInToken

        return stringKey;
    }

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

Examples of org.exoplatform.web.security.GateInToken

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

Examples of org.exoplatform.web.security.GateInToken

    public void cleanExpiredTokens() {
        Map<String, TokenEntry> tokens = getTokens();
        if (tokens != null) {
            for (TokenEntry en : tokens.values()) {
                GateInToken token = en.getToken();
                if (token.isExpired()) {
                    en.remove();
                }
            }
        }
    }
View Full Code Here

Examples of org.exoplatform.web.security.GateInToken

    @Destroy
    public abstract void remove();

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

Examples of org.exoplatform.web.security.GateInToken

            if (en != null) {
                HashedToken hashedToken = getMixin(en, HashedToken.class);
                if (hashedToken != null && hashedToken.getHashedToken() != null) {
                    try {
                        if (saltedHashService.validate(token.getRandomString(), hashedToken.getHashedToken())) {
                            GateInToken encryptedToken = en.getToken();
                            Credentials encryptedCredentials = encryptedToken.getPayload();
                            Credentials decryptedCredentials = new Credentials(encryptedCredentials.getUsername(),

                            codec.decode(encryptedCredentials.getPassword()));
                            if (remove) {
                                en.remove();
                            }
                            return new GateInToken(encryptedToken.getExpirationTimeMillis(), decryptedCredentials);
                        }
                    } catch (SaltedHashException e) {
                        log.warn("Could not validate cookie token against its salted hash.", e);
                    }
                }
View Full Code Here

Examples of org.exoplatform.web.security.GateInToken

      {
         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

Examples of org.exoplatform.web.security.GateInToken

            if (en != null) {
                HashedToken hashedToken = getMixin(en, HashedToken.class);
                if (hashedToken != null && hashedToken.getHashedToken() != null) {
                    try {
                        if (saltedHashService.validate(token.getRandomString(), hashedToken.getHashedToken())) {
                            GateInToken encryptedToken = en.getToken();
                            Credentials encryptedCredentials = encryptedToken.getPayload();
                            Credentials decryptedCredentials = new Credentials(encryptedCredentials.getUsername(),

                            codec.decode(encryptedCredentials.getPassword()));
                            if (remove) {
                                en.remove();
                            }
                            return new GateInToken(encryptedToken.getExpirationTimeMillis(), decryptedCredentials);
                        }
                    } catch (SaltedHashException e) {
                        log.warn("Could not validate cookie token against its salted hash.", e);
                    }
                }
View Full Code Here

Examples of org.exoplatform.web.security.GateInToken

        if (credentials == null) {
            throw new NullPointerException();
        }
        String tokenId = nextTokenId();
        long expirationTimeMillis = System.currentTimeMillis() + validityMillis;
        tokens.put(tokenId, new GateInToken(expirationTimeMillis, credentials));
        return tokenId;
    }
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.