public override void Load()
 {
   Bind<IOAuthContextBuilder>().To<OAuthContextBuilder>();
   var nonceStoreInspector = new NonceStoreInspector(new TestNonceStore());
   var consumerStore = new TestConsumerStore();
   var signatureInspector = new SignatureValidationInspector(consumerStore);
   var consumerValidationInspector = new ConsumerValidationInspector(consumerStore);
   var timestampInspector = new TimestampRangeInspector(new TimeSpan(1,0 , 0));
   var tokenRepository = new TokenRepository();
   var tokenStore = new SampleMemoryTokenStore(tokenRepository);
   var oauthProvider = new OAuthProvider(tokenStore,consumerValidationInspector, nonceStoreInspector,timestampInspector, signatureInspector);
   Bind<IOAuthProvider>().ToConstant(oauthProvider);
   Bind<TokenRepository>().ToConstant(tokenRepository);
 }
Beispiel #2
0
        public override void Load()
        {
            Bind <IOAuthContextBuilder>().To <OAuthContextBuilder>();
            var nonceStoreInspector         = new NonceStoreInspector(new TestNonceStore());
            var consumerStore               = new TestConsumerStore();
            var signatureInspector          = new SignatureValidationInspector(consumerStore);
            var consumerValidationInspector = new ConsumerValidationInspector(consumerStore);
            var timestampInspector          = new TimestampRangeInspector(new TimeSpan(1, 0, 0));
            var tokenRepository             = new TokenRepository();
            var tokenStore    = new SampleMemoryTokenStore(tokenRepository);
            var oauthProvider = new OAuthProvider(tokenStore, consumerValidationInspector, nonceStoreInspector, timestampInspector, signatureInspector);

            Bind <IOAuthProvider>().ToConstant(oauthProvider);
            Bind <TokenRepository>().ToConstant(tokenRepository);
        }