Examples of GateInToken


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 GateInToken getTokenAndDecode(String tokenId, AbstractCodec codec) {
        Map<String, TokenEntry> tokens = getTokens();
        TokenEntry entry = tokens.get(tokenId);
        if (entry != null) {
            GateInToken gateInToken = entry.getToken();
            Credentials payload = gateInToken.getPayload();

            // Return a cloned GateInToken
            return new GateInToken(gateInToken.getExpirationTimeMillis(), new Credentials(payload.getUsername(),
                    codec.decode(payload.getPassword())));

        }
        return null;
    }
View Full Code Here

Examples of org.exoplatform.web.security.GateInToken

        return new TokenTask<String>() {
            @Override
            protected String execute() {
                String tokenId = nextTokenId();
                long expirationTimeMillis = System.currentTimeMillis() + validityMillis;
                GateInToken token = new GateInToken(expirationTimeMillis, credentials);
                TokenContainer container = getTokenContainer();

                // Save the token, password is encoded thanks to the codec
                container.encodeAndSaveToken(tokenId, token.getPayload(), new Date(expirationTimeMillis), codec);
                return tokenId;
            }
        }.executeWith(chromatticLifeCycle);
    }
View Full Code Here

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

Examples of org.exoplatform.web.security.GateInToken

   }

   @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

   {
      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

Examples of org.exoplatform.web.security.GateInToken

   {
      Map<String, TokenEntry> tokens = getTokens();
      TokenEntry entry = tokens.get(tokenId);
      if(entry != null)
      {
         GateInToken gateInToken = entry.getToken();
         Credentials payload = gateInToken.getPayload();
        
         //Return a cloned GateInToken
         return new GateInToken(gateInToken.getExpirationTimeMillis(), new Credentials(payload.getUsername(), codec
               .decode(payload.getPassword())));

      }
      return null;
   }
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

         @Override
         protected String execute()
         {
            String tokenId = nextTokenId();
            long expirationTimeMillis = System.currentTimeMillis() + validityMillis;
            GateInToken token = new GateInToken(expirationTimeMillis, credentials);
            TokenContainer container = getTokenContainer();
           
            //Save the token, password is encoded thanks to the codec
            container.encodeAndSaveToken(tokenId, token.getPayload(), new Date(expirationTimeMillis), codec);
            return tokenId;
         }
      }.executeWith(chromatticLifeCycle);
   }
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.