Package org.exoplatform.web.security

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


    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

    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

        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

      {
         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

   {
      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

   @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();
           
            //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

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.