예제 #1
0
 /**
  * Create response parameters.
  */
 public OAuthResponseParams(ISecurityToken securityToken, sRequest originalRequest,
                            BlobCrypter stateCrypter)
 {
     this.securityToken   = securityToken;
     this.originalRequest = originalRequest;
     newClientState       = new OAuthClientState(stateCrypter);
 }
예제 #2
0
 public OAuthCrypterProvider(String stateCrypterPath)
 {
     if (String.IsNullOrEmpty(stateCrypterPath))
     {
         crypter = new BasicBlobCrypter(Crypto.getRandomBytes(BasicBlobCrypter.MASTER_KEY_MIN_LEN));
     }
     else
     {
         crypter = new BasicBlobCrypter(stateCrypterPath);
     }
 }
예제 #3
0
 public OAuthCrypterProvider(String stateCrypterPath)
 {
     if (String.IsNullOrEmpty(stateCrypterPath)) 
     {
         crypter = new BasicBlobCrypter(Crypto.getRandomBytes(BasicBlobCrypter.MASTER_KEY_MIN_LEN));
     } 
     else 
     {
         crypter = new BasicBlobCrypter(stateCrypterPath);
     }
 }
예제 #4
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>();
 }
예제 #5
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>();
        }
예제 #6
0
 protected OAuthFetcherConfig()
 {
     byte[] masterKey = Crypto.getRandomBytes(BasicBlobCrypter.MASTER_KEY_MIN_LEN);
     this.stateCrypter = new BasicBlobCrypter(masterKey);
     this.tokenStore = new GadgetOAuthTokenStore(BasicOAuthStore.Instance, DefaultGadgetSpecFactory.Instance);
 }
예제 #7
0
 protected OAuthFetcherConfig()
 {
     byte[] masterKey = Crypto.getRandomBytes(BasicBlobCrypter.MASTER_KEY_MIN_LEN);
     this.stateCrypter = new BasicBlobCrypter(masterKey);
     this.tokenStore   = new GadgetOAuthTokenStore(BasicOAuthStore.Instance, DefaultGadgetSpecFactory.Instance);
 }
예제 #8
0
 /**
  * Create a new, empty client state blob.
  *
  * @param crypter
  */
 public OAuthClientState(BlobCrypter crypter)
 {
     state        = new Dictionary <string, string>();
     this.crypter = crypter;
 }
예제 #9
0
 /**
 * Create a new, empty client state blob.
 * 
 * @param crypter
 */
 public OAuthClientState(BlobCrypter crypter)
 {
     state = new Dictionary<string, string>();
     this.crypter = crypter;
 }
예제 #10
0
 /**
  * Create response parameters.
  */
 public OAuthResponseParams(ISecurityToken securityToken, sRequest originalRequest,
     BlobCrypter stateCrypter)
 {
     this.securityToken = securityToken;
     this.originalRequest = originalRequest;
     newClientState = new OAuthClientState(stateCrypter);
 }