internal static AuthUser CreateFromCache(IAuth auth, IUserTokenStore store, string openId) { return(new AuthUser(auth, store) { OpenId = openId }); }
public void InitializeTest() { _mockFantasizer = MockRepository.GenerateMock<IFantasizerService>(); _mockUserTokenStore = MockRepository.GenerateMock<IUserTokenStore>(); _userController = new UserController(_mockUserTokenStore, _mockFantasizer); _testObjectFactory = new TestObjectFactory(); }
public BaseAuthenticatedController(IUserTokenStore userTokenStore, IFantasizerService fantasizer) : base() { _userTokenStore = userTokenStore; _fantasizer = fantasizer; PopulateUserAuthViewData(); }
public TeamController( IUserTokenStore userTokenStore, IFantasizerService fantasizer, ISessionFactory sessionFactory) : base(userTokenStore, fantasizer) { _sessionFactory = sessionFactory; }
public void InitailizeTest() { _mockUserTokenStore = MockRepository.GenerateMock<IUserTokenStore>(); _mockFantasizer = MockRepository.GenerateMock<IFantasizerService>(); _mockSessionFactory = MockRepository.GenerateMock<ISessionFactory>(); _testObjectFactory = new TestObjectFactory(); _teamController = new TeamController(_mockUserTokenStore, _mockFantasizer, _mockSessionFactory); }
public void InitializeTest() { _mockFantasizer = MockRepository.GenerateMock<IFantasizerService>(); _mockUserTokenStore = MockRepository.GenerateMock<IUserTokenStore>(); _mockConfiguration = MockRepository.GenerateMock<IApplicationConfiguration>(); _mockHttpContext = MockRepository.GenerateMock<HttpContextBase>(); _homeController = new HomeController(_mockUserTokenStore, _mockFantasizer, _mockConfiguration); _testObjectFactory = new TestObjectFactory(); }
public OAuthClient(IUserTokenStore userTokenStore, string consumerKey, string consumerSecret) { _userTokenStore = userTokenStore; this.ConsumerKey = consumerKey; this.ConsumerSecret = consumerSecret; this.Consumer = new WebConsumer(FantasizerConfiguration.Description, new UserTokenManager(_userTokenStore, this.ConsumerKey, this.ConsumerSecret)); }
internal static AuthUser Create(IAuth auth, IUserTokenStore store, string code) { var result = new AuthUser(auth, store); var token = result.Auth.GetUserToken(code); result.OpenId = token.openid; result.UserTokenStore.Set(result.OpenId, token); return(result); }
public ClientCredentialsHandler( ITokenStore tokenStore, IUserTokenStore userTokenStore, IOptions <TConfig> config ) { this.tokenStore = tokenStore; this.userTokenStore = userTokenStore; this.config = config.Value; }
public EncryptingUserTokenStoreDecorator( IUserTokenStore decorated, IDataProtectionProvider dataProtectionProvider, ILogger <EncryptingUserTokenStoreDecorator> logger) { _decorated = decorated; _logger = logger; _baseProtector = dataProtectionProvider.CreateProtector(nameof(EncryptingUserTokenStoreDecorator)) as IPersistedDataProtector ?? throw new Exception("Protection provider doesn't support persisted data protector"); }
/// <summary> /// ctor /// </summary> /// <param name="userTokenStore"></param> /// <param name="clock"></param> /// <param name="options"></param> /// <param name="tokenEndpointService"></param> /// <param name="logger"></param> public UserAccessAccessTokenManagementService( IUserTokenStore userTokenStore, ISystemClock clock, IOptions <AccessTokenManagementOptions> options, ITokenEndpointService tokenEndpointService, ILogger <UserAccessAccessTokenManagementService> logger) { _userTokenStore = userTokenStore; _clock = clock; _options = options.Value; _tokenEndpointService = tokenEndpointService; _logger = logger; }
/// <summary> /// ctor /// </summary> /// <param name="userTokenStore"></param> /// <param name="clock"></param> /// <param name="options"></param> /// <param name="tokenEndpointService"></param> /// <param name="httpContextAccessor"></param> /// <param name="logger"></param> public AccessTokenManagementService( IUserTokenStore userTokenStore, ISystemClock clock, IOptions <AccessTokenManagementOptions> options, ITokenEndpointService tokenEndpointService, IHttpContextAccessor httpContextAccessor, ILogger <AccessTokenManagementService> logger) { _userTokenStore = userTokenStore; _clock = clock; _options = options.Value; _tokenEndpointService = tokenEndpointService; _httpContextAccessor = httpContextAccessor; _logger = logger; }
public OAuthTokenProvider( ILogger <OAuthTokenProvider> logger, IOptions <OAuthOptions> options, AccountLinkingStateService oAuthStateService, OAuthServiceClient oAuthServiceClient, IUserTokenStore userTokenStore, IReplayValidator replayValidator) { _logger = logger; _options = options.Value; _oAuthStateService = oAuthStateService; _oAuthServiceClient = oAuthServiceClient; _userTokenStore = userTokenStore; _replayValidator = replayValidator; }
public UserTokenManager(IUserTokenStore userTokenStore, string consumerKey, string consumerSecret) { if (userTokenStore == null) { throw new ArgumentNullException("A userTokenStore implementation is required for OAuth authentication."); } if (string.IsNullOrEmpty(consumerKey)) { throw new ArgumentNullException("A valid consumerKey is required for OAuth authentication."); } if (string.IsNullOrEmpty(consumerSecret)) { throw new ArgumentNullException("A valid consumerSecret is required for OAuth authentication."); } this.ConsumerKey = consumerKey; this.ConsumerSecret = consumerSecret; _userTokenStore = userTokenStore; }
public UserTokenService(IUserTokenStore userTokenStore, IBankAuthTokenProvider bankAuthTokenProvider) { this.userTokenStore = userTokenStore; this.bankAuthTokenProvider = bankAuthTokenProvider; }
/// <summary> /// 创建 /// </summary> /// <param name="config"></param> public Auth(IConfig config) { Config = config; UserTokenStore = new Provider.InProcess.UserTokenStore(); }
/// <summary> /// 创建授权用户 /// </summary> /// <param name="auth"></param> /// <param name="store"></param> private AuthUser(IAuth auth, IUserTokenStore store) { Auth = auth ?? throw new ArgumentNullException("auth"); UserTokenStore = store ?? throw new ArgumentNullException("store"); }
public FantasizerService(string consumerKey, string consumerSecret, IUserTokenStore userTokenStore) { _consumerKey = consumerKey; _consumerSecret = consumerSecret; _oAuthClient = new OAuthClient(userTokenStore, consumerKey, consumerSecret); }
public static IFantasizerService CreateFantasizerClient(string consumerKey, string consumerSecret, IUserTokenStore userTokenStore) { return new FantasizerService(consumerKey, consumerSecret, userTokenStore); }
public TrueLayerDataClientBuilder(IUserTokenStore userTokenStore, IOptionsMonitor <TrueLayerOAuthClientOptions> truelayerOAuthClientOptions) { this.userTokenStore = userTokenStore; this.truelayerOAuthClientOptions = truelayerOAuthClientOptions.CurrentValue; }
public InternalController(IUserTokenStore userTokenStore, IFantasizerService fantasizer) : base(userTokenStore, fantasizer) { }
public HomeController(IUserTokenStore userTokenStore, IFantasizerService fantasizer, IApplicationConfiguration configuration) : base(userTokenStore, fantasizer) { _configuration = configuration; }