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