Exemple #1
0
 /**
 * Initialize client state based on an encrypted blob passed by the
 * client.
 * 
 * @param crypter
 * @param stateBlob
 */
 public OAuthClientState(BlobCrypter crypter, String stateBlob)
 {
     this.crypter = crypter;
     Dictionary<string, string> _state = null;
     if (!String.IsNullOrEmpty(stateBlob))
     {
         try
         {
             _state = crypter.unwrap(stateBlob, CLIENT_STATE_MAX_AGE_SECS);
         }
         catch (BlobCrypterException)
         {
             // Probably too old, pretend we never saw it at all.
         }
     }
     state = _state ?? new Dictionary<string, string>();
 }
        /**
         * Initialize client state based on an encrypted blob passed by the
         * client.
         *
         * @param crypter
         * @param stateBlob
         */
        public OAuthClientState(BlobCrypter crypter, String stateBlob)
        {
            this.crypter = crypter;
            Dictionary <string, string> _state = null;

            if (!String.IsNullOrEmpty(stateBlob))
            {
                try
                {
                    _state = crypter.unwrap(stateBlob, CLIENT_STATE_MAX_AGE_SECS);
                }
                catch (BlobCrypterException)
                {
                    // Probably too old, pretend we never saw it at all.
                }
            }
            state = _state ?? new Dictionary <string, string>();
        }
 /**
  * Generates a token from an input string
  * @param token String form of token
  * @param maxAge max age of the token (in seconds)
  * @throws BlobCrypterException
  */
 public BasicSecurityToken(String token, int maxAge)
 {
     this.token = token;
     tokenData  = crypter.unwrap(token, maxAge);
 }