/// <summary>
 /// Load your modules or register your services here!
 /// </summary>
 /// <param name="kernel">The kernel.</param>
 private static void RegisterServices(IKernel kernel)
 {
     kernel.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);
     kernel.Bind<IOAuthProvider>().ToConstant(oauthProvider);
     kernel.Bind<TokenRepository>().ToConstant(tokenRepository);
 }		
Exemple #2
0
        /// <summary>
        /// Load your modules or register your services here!
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        private static void RegisterServices(IKernel kernel)
        {
            kernel.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);

            kernel.Bind <IOAuthProvider>().ToConstant(oauthProvider);
            kernel.Bind <TokenRepository>().ToConstant(tokenRepository);
        }
  public HomeController(TokenRepository repository)
 {
   _repository = repository;
 }
 public SampleMemoryTokenStore(TokenRepository repository)
 {
     _repository = repository;
 }
Exemple #5
0
 public SampleMemoryTokenStore(TokenRepository repository)
 {
     _repository = repository;
 }
 public AccountController(TokenRepository tokenRepository)
 {
   _tokenRepository = tokenRepository;
 }