Exemplo n.º 1
0
 /// <summary>
 /// Creates a new instance. This class is also used to shareable a context across all instance that are created below one Cluster instance.
 /// One configuration instance per Cluster instance.
 /// </summary>
 internal Configuration(Policies policies,
     ProtocolOptions protocolOptions,
     PoolingOptions poolingOptions,
     SocketOptions socketOptions,
     ClientOptions clientOptions,
     IAuthProvider authProvider,
     IAuthInfoProvider authInfoProvider,
     QueryOptions queryOptions,
     IAddressTranslator addressTranslator)
 {
     if (addressTranslator == null)
     {
         throw new ArgumentNullException("addressTranslator");
     }
     if (queryOptions == null)
     {
         throw new ArgumentNullException("queryOptions");
     }
     _policies = policies;
     _protocolOptions = protocolOptions;
     _poolingOptions = poolingOptions;
     _socketOptions = socketOptions;
     _clientOptions = clientOptions;
     _authProvider = authProvider;
     _authInfoProvider = authInfoProvider;
     _queryOptions = queryOptions;
     _addressTranslator = addressTranslator;
 }
Exemplo n.º 2
0
        internal ControlConnection(Cluster cluster,
                                   IEnumerable<IPAddress> clusterEndpoints,
                                   Policies policies,
                                   ProtocolOptions protocolOptions,
                                   PoolingOptions poolingOptions,
                                   SocketOptions socketOptions,
                                   ClientOptions clientOptions,
                                   IAuthProvider authProvider,
                                   IAuthInfoProvider authInfoProvider)
        {
            _cluster = cluster;
            _reconnectionSchedule = _reconnectionPolicy.NewSchedule();
            _reconnectionTimer = new Timer(ReconnectionClb, null, Timeout.Infinite, Timeout.Infinite);

            var config = new Configuration
            (
                policies,
                protocolOptions,
                poolingOptions,
                socketOptions,
                clientOptions,
                authProvider,
                authInfoProvider,
                new QueryOptions()
            );

            _session = new Session(cluster, config, "", ControlConnectionProtocolVersion);
        }
Exemplo n.º 3
0
 public StartupParams(IAuthProvider provider, IPathManager pathManager,
     ICustomNodeManager customNodeManager)
 {
     this.authProvider = provider;
     this.pathManager = pathManager;
     this.customNodeManager = customNodeManager;
 }
 public VerifyUserAccountController(IUserRepo urep, IAuthProvider auth, IAccountRepo account, ICCFolderRepo folderRep)
 {
     userRepository = urep;
     authProvider = auth;
     accRepository = account;
     CCFolderRepository = folderRep;
 }
Exemplo n.º 5
0
        public AuthFeature(Func<IAuthSession> sessionFactory, IAuthProvider[] authProviders, string htmlRedirect = null)
        {
            this.sessionFactory = sessionFactory;
            this.authProviders = authProviders;

            Func<string,string> localize = HostContext.ResolveLocalizedString;

            ServiceRoutes = new Dictionary<Type, string[]> {
                { typeof(AuthenticateService), new[]
                    {
                        "/" + localize(LocalizedStrings.Auth), 
                        "/" + localize(LocalizedStrings.Auth) + "/{provider}", 
                        "/" + localize(LocalizedStrings.Authenticate), 
                        "/" + localize(LocalizedStrings.Authenticate) + "/{provider}",
                    } },
                { typeof(AssignRolesService), new[]{ "/" + localize(LocalizedStrings.AssignRoles) } },
                { typeof(UnAssignRolesService), new[]{ "/" + localize(LocalizedStrings.UnassignRoles) } },
            };

            RegisterPlugins = new List<IPlugin> {
                new SessionFeature()                          
            };

            this.HtmlRedirect = htmlRedirect ?? "~/" + localize(LocalizedStrings.Login);
        }
Exemplo n.º 6
0
        public AuthFeature(Func<IAuthSession> sessionFactory, IAuthProvider[] authProviders, string htmlRedirect = null)
        {
            this.sessionFactory = sessionFactory;
            this.authProviders = authProviders;

            Func<string,string> localize = s => HostContext.AppHost.ResolveLocalizedString(s, null);

            ServiceRoutes = new Dictionary<Type, string[]> {
                { typeof(AuthenticateService), new[]
                    {
                        "/" + localize(LocalizedStrings.Auth), 
                        "/" + localize(LocalizedStrings.Auth) + "/{provider}", 
                        "/" + localize(LocalizedStrings.Authenticate), 
                        "/" + localize(LocalizedStrings.Authenticate) + "/{provider}",
                    } },
                { typeof(AssignRolesService), new[]{ "/" + localize(LocalizedStrings.AssignRoles) } },
                { typeof(UnAssignRolesService), new[]{ "/" + localize(LocalizedStrings.UnassignRoles) } },
            };

            RegisterPlugins = new List<IPlugin> {
                new SessionFeature()        
            };

            AuthEvents = new List<IAuthEvents>();

            this.HtmlRedirect = htmlRedirect ?? "~/" + localize(LocalizedStrings.Login);
            this.IncludeAuthMetadataProvider = true;
            this.ValidateUniqueEmails = true;
            this.DeleteSessionCookiesOnLogout = true;
        }
Exemplo n.º 7
0
 public void SetUp()
 {
   AppraiserSignUpService = Substitute.For<IAppraiserSignUpService>();
   AuthProvider = Substitute.For<IAuthProvider>();
   Target = new AppraiserSignUpController(AppraiserSignUpService, AuthProvider);
   Target.CommitProviderInstance = Substitute.For<ICommitProvider>();
 }
 /// <summary>
 /// Disposes of the resources (other than memory) used by the module that implements <see cref="T:System.Web.IHttpModule"/>.
 /// </summary>
 public void Dispose()
 {
     if( _aP != null ) {
         _aP.Dispose();
         _aP = null;
     }
 }
		public TpAuthenticationManager()
		{
			_authProvider = this;
			_password = SettingsManager.UserPassword;
			_userName = SettingsManager.UserName;
			_isIntegrated = SettingsManager.UseIntegratedAuth;
		}
Exemplo n.º 10
0
 public Gist(
     ILogProvider logProvider,
     ICacheProvider cacheProvider,
     IAuthProvider authProvider)
     : base(
         logProvider,
         cacheProvider,
         authProvider) { }
 public SettingsController(IUserService userService, IAuthProvider authProvider, 
     ILocationService locationService, IHash hash)
 {
     _userService = new UserServiceClient();
     _authProvider = authProvider;
     _locationService = new LocationServiceClient();
     _hash = hash;
 }
Exemplo n.º 12
0
 public UserController(IAuthProvider authProvider)
 {
     _postService = new PostServiceClient();
     _friendService = new FriendServiceClient();
     _userService = new UserServiceClient();
     _authProvider = authProvider;
     _commentService = new CommentServiceClient();
 }
 public override void Configure(Container container)
 {
     var authProviders = new IAuthProvider[] { new AadAuthProvider(AppSettings) };
     Plugins.Add(new AuthFeature(
         () => new AuthUserSession(), 
         authProviders,
         htmlRedirect: "/auth/aad"));
 }
Exemplo n.º 14
0
    public void SetUp()
    {
      _authProvider = MockRepository.GenerateMock<IAuthProvider>();
      _adminController = new AdminController(_authProvider);

      var httpContextMock = MockRepository.GenerateMock<HttpContextBase>();
      _adminController.Url = new UrlHelper(new RequestContext(httpContextMock, new RouteData()));
    }
		protected AbstractMasterDetailPage (IAuthProvider ap) : base()
		{
			Icon = GetIcon();

			this.ap = ap;
			ShowPersonalPages (ap.AuthState.IsAuthorised);
			ap.AuthState.OnAuthChange += OnAuthChange;
		}
Exemplo n.º 16
0
 private async Task InstallNew(GroupContent mod, IAuthProvider provider, Action<SyncOptions> config,
     IAbsoluteDirectoryPath folder) {
     SetupHosts(mod, provider);
     var opts = new SyncOptions();
     config(opts);
     await
         Repository.Factory.Clone(opts.Hosts, folder.ToString(), config)
             .ConfigureAwait(false);
 }
Exemplo n.º 17
0
		public HomeController(IUsersManagement userManagement,
			IAuthProvider authenticationProvider, IUserAccessHelper userAccessHelper, IAppraiserManagement appraiserManagement, ITaskManager taskManager)
		{
			_userManagement = userManagement;
			_authenticationProvider = authenticationProvider;
			_userAccessHelper = userAccessHelper;
			_appraiserManagement = appraiserManagement;
			_taskManager = taskManager;
		}
Exemplo n.º 18
0
        public AccountController(IAuthProvider authProvider, IAccountRepository accountRepository)
        {
            Guard.ArgNotNull(authProvider, "authProvider");
            Guard.ArgNotNull(accountRepository, "accountRepository");

            _authProvider = authProvider;
            _accountRepository = accountRepository;
            if (_managerService == null)
                _managerService = new SnippetCacheManagerServiceClient();
        }
Exemplo n.º 19
0
 public StartupParams(IAuthProvider provider, IPathManager pathManager,
     ILibraryLoader libraryLoader, ICustomNodeManager customNodeManager,
     Version dynamoVersion)
 {
     this.authProvider = provider;
     this.pathManager = pathManager;
     this.libraryLoader = libraryLoader;
     this.customNodeManager = customNodeManager;
     this.dynamoVersion = dynamoVersion;
 }
        public BasicAuthenticationModule()
        {
            var provider = ConfigReader.GetConfigValue("ODataTFS.AuthProvider");
            var tfsServer = ConfigReader.GetConfigValue("ODataTFS.TfsServer");

            var providerType = Type.GetType(provider, true);
            var tfsServerUri = new Uri(tfsServer, UriKind.Absolute);

            this.authProvider = Activator.CreateInstance(providerType, new[] { tfsServerUri }) as IAuthProvider;
        }
Exemplo n.º 21
0
        public AccountController(IAuthProvider authProvider, IAccountRepository accountRepository,
                                 ISnippetCacheManagerService managerService)
        {
            Guard.ArgNotNull(authProvider, "authProvider");
            Guard.ArgNotNull(accountRepository, "accountRepository");
            Guard.ArgNotNull(managerService, "managerService");

            _authProvider = authProvider;
            _accountRepository = accountRepository;
            _managerService = managerService;
        }
Exemplo n.º 22
0
 public LoginController(IAuthProvider auth, IUserRepo userRepo, ICCFolderRepo folder, IAccountRepo account, ICCTokenRepo token, INotificationManager notifMgr, ICCItemRepo item, ICCErrorLogRepo errorlogs)
 {
     authProvider = auth;
     userRepository = userRepo;
     CCFolderRepository = folder;
     accRepository = account;
     CCTokenRepository = token;
     notifManager = notifMgr;
     items = item;
     CCErrorLogRepository = errorlogs;
 }
Exemplo n.º 23
0
        public AuthenticationManager(IAuthProvider authProvider)
        {
            this.authProvider = authProvider;

            // The lack of AuthProvider indicates that the user cannot login for this
            // session.  Hence, we do not subscribe to this event.
            if (this.authProvider != null)
            {
                this.authProvider.LoginStateChanged += OnLoginStateChanged;
            }
        }
Exemplo n.º 24
0
 private void ConfigureAuthentication()
 {
     var authProviders = new IAuthProvider[]
         {
             new ServiceStackCredentialsAuthAdapter(this.unityContainer)
         };
     var authFeature = new AuthFeature(() => new AuthUserSession(), authProviders)
         {
            IncludeAssignRoleServices = false
         };
     this.Plugins.Add(authFeature);
 }
Exemplo n.º 25
0
        private void ConfigureAuth(Container container) {
            container.Register(GetUserSession).ReusedWithin(ReuseScope.Request);
            container.Register(GetUserProfile).ReusedWithin(ReuseScope.Request);
            container.RegisterAutoWiredAs<OrmLiteAuthRepository, IAuthRepository>().ReusedWithin(ReuseScope.Request);
            container.RegisterAutoWiredAs<OrmLiteAuthRepository, IUserAuthRepository>().ReusedWithin(ReuseScope.Request);

            var auth_providers = new IAuthProvider[] { new CredentialsAuthProvider() };
            var auth_feature = new AuthFeature(() => new BoilerUserSession(), auth_providers) {
                HtmlRedirect = "/index.html"
            };
            Plugins.Add(auth_feature);
        }
Exemplo n.º 26
0
 public SignUpController(IPlanRepo repo, IAccountRepo accRepo, IFeatureRepo featureRepo, IUserRepo userRepo, IPurchasedFeatureRepo ppRepo, IAuthProvider auth, ICCFolderRepo folder, ICCTokenRepo token, INotificationManager notifMgr)
 {
     planRepository = repo;
     accountRepository = accRepo;
     featureRepository = featureRepo;
     userRepository = userRepo;
     ppRepository = ppRepo;
     authProvider = auth;
     CCFolderRepository = folder;
     CCTokenRepository = token;
     notifManager = notifMgr;
     //SetConnectionString();
 }
Exemplo n.º 27
0
        public ZsyncLauncher(IProcessManager processManager, IPathConfiguration configuration,
            ZsyncOutputParser parser, IAuthProvider authProvider) {
            if (processManager == null)
                throw new ArgumentNullException("processManager");
            if (configuration == null)
                throw new ArgumentNullException("configuration");

            _authProvider = authProvider;

            _processManager = processManager;
            _parser = parser;
            _binPath = configuration.ToolCygwinBinPath.GetChildFileWithName("zsync.exe");
        }
Exemplo n.º 28
0
        public AuthFeature(Func<IAuthSession> sessionFactory, IAuthProvider[] authProviders)
        {
            this.sessionFactory = sessionFactory;
            this.authProviders = authProviders;

            ServiceRoutes = new Dictionary<Type, string[]> {
                { typeof(AuthService), new[]{"/auth", "/auth/{provider}"} },
                { typeof(AssignRolesService), new[]{"/assignroles"} },
                { typeof(UnAssignRolesService), new[]{"/unassignroles"} },
            };
            RegisterPlugins = new List<IPlugin> {
                new SessionFeature()
            };
        }
Exemplo n.º 29
0
		public void SetUp()
		{
			_resetPasswordService = Substitute.For<IResetPasswordService>();
			_taskManager = Substitute.For<ITaskManager>();
			_authenticationProvider = Substitute.For<IAuthProvider>();

			_target = new ResetPasswordController(_resetPasswordService, _taskManager, _authenticationProvider);
			_viewContext = new ViewContext();
			_viewContext.HttpContext = MockHttpContext.FakeHttpContext();
			_target.SetFakeControllerContext(_viewContext.HttpContext);
			_target.CommitProviderInstance = Substitute.For<ICommitProvider>();

			_sessionId = Guid.NewGuid().ToString().Replace("-", "");
		}
Exemplo n.º 30
0
        public async Task GetMod(GroupContent mod, IAbsoluteDirectoryPath destination, IAbsoluteDirectoryPath packPath,
            StatusRepo status, IAuthProvider provider, bool force = false) {
            var folder = destination.GetChildDirectoryWithName(mod.PackageName);

            if (!folder.Exists) {
                await InstallNew(mod, provider, GetOpts(packPath, status, mod), folder).ConfigureAwait(false);
                return;
            }

            var rsyncDir = folder.GetChildDirectoryWithName(Repository.RepoFolderName);
            if (!force && rsyncDir.Exists && IsRightVersion(rsyncDir, mod))
                return;
            await UpdateExisting(mod, provider, rsyncDir, folder, GetOpts(packPath, status, mod)).ConfigureAwait(false);
        }
 public ParksController(IParksDAO parksDAO, IWeatherDAO weatherDAO, IAuthProvider authProvider) : base(authProvider)
 {
     this.ParksDAO   = parksDAO;
     this.WeatherDAO = weatherDAO;
 }
Exemplo n.º 32
0
 public AccountController(IAuthProvider auto)
 {
     this.auto = auto;
 }
Exemplo n.º 33
0
 public BrugerController(IAuthProvider auth)
 {
     authProvider = auth;
 }
Exemplo n.º 34
0
 public GregClient(IAuthProvider provider, string packageManagerUrl)
 {
     _authProvider = provider;
     _client       = new RestClient(packageManagerUrl);
 }
Exemplo n.º 35
0
 public static void StoreAuthResult(this IBotContext context, AuthResult authResult, IAuthProvider authProvider) =>
 context.UserData.SetValue($"{authProvider.Name}{ContextConstants.AuthResultKey}", authResult);
Exemplo n.º 36
0
 public AuthController(IAuthProvider authProvider, IMapper mapper)
 {
     _authProvider = authProvider;
     _mapper       = mapper;
 }
Exemplo n.º 37
0
 public AuthController(IAuthProvider _authProvider)
 {
     authprovider = _authProvider;
 }
 public UserController(IAuthProvider authParam)
 {
     auth = authParam;
 }
Exemplo n.º 39
0
 public AccountController(IAuthProvider ap)
 {
     authProvider = ap;
 }
Exemplo n.º 40
0
 public AccountController(IAuthProvider authProvider)
 {
     this.authProvider = authProvider;
 }
Exemplo n.º 41
0
 public AccountsController(IUnitOfWork unitOfWork, IAccountRepository accountRepository, IAuthProvider authProvider)
 {
     _accountRepository = accountRepository ?? throw new ArgumentNullException(nameof(accountRepository));
     _unitOfWork        = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork));
     _authProvider      = authProvider ?? throw new ArgumentNullException(nameof(authProvider));
 }
Exemplo n.º 42
0
 public AdminController(IDeckDAL decksSqlDAL, IAuthProvider authProvider)
 {
     this.decksSqlDAL  = decksSqlDAL;
     this.authProvider = authProvider;
 }
Exemplo n.º 43
0
 public HomeController(IAuthProvider authProvider, IDecksDAL decksDAL, ICardsDAL cardsDAL)
 {
     this.authProvider = authProvider;
     this.decksDAL     = decksDAL;
     this.cardsDAL     = cardsDAL;
 }
Exemplo n.º 44
0
 /// <summary>
 ///  Uses the provided credentials when connecting to Cassandra hosts. <p> This
 ///  should be used if the Cassandra cluster has been configured to use the
 ///  <c>PasswordAuthenticator</c>. If the the default <c>*
 ///  AllowAllAuthenticator</c> is used instead, using this method has no effect.</p>
 /// </summary>
 /// <param name="username"> the user name to use to login to Cassandra hosts.</param>
 /// <param name="password"> the password corresponding to </param>
 /// <returns>this Builder</returns>
 public Builder WithCredentials(String username, String password)
 {
     _authInfoProvider = new SimpleAuthInfoProvider().Add("username", username).Add("password", password);
     _authProvider     = new PlainTextAuthProvider(username, password);
     return(this);
 }
Exemplo n.º 45
0
 public AuthDialog(IAuthProvider AuthProvider, AuthenticationOptions AuthOptions, string Prompt = "Please click to sign in: ")
 {
     this.prompt       = Prompt;
     this.authProvider = AuthProvider;
     this.authOptions  = AuthOptions;
 }
 public AccountController(IAuthProvider authProvider)
 {
     _userService  = new UserServiceClient();
     _authProvider = authProvider;
 }
Exemplo n.º 47
0
 public AccountController(IAuthProvider auth, IUserRepository user)
 {
     this.authProvider   = auth;
     this.userRepository = user;
 }
Exemplo n.º 48
0
        /// <summary>
        /// The specified <paramref name="session"/> may change as a side-effect of this method. If
        /// subsequent code relies on current <see cref="IAuthSession"/> data be sure to reload
        /// the session istance via <see cref="ServiceExtensions.GetSession(IServiceBase,bool)"/>.
        /// </summary>
        private object Authenticate(Authenticate request, string provider, IAuthSession session, IAuthProvider oAuthConfig)
        {
            if (request.provider == null && request.UserName == null)
            {
                return(null); //Just return sessionInfo if no provider or username is given
            }
            var authFeature        = HostContext.GetPlugin <AuthFeature>();
            var generateNewCookies = authFeature == null || authFeature.GenerateNewSessionCookiesOnAuthentication;

            object response = null;

            if (!oAuthConfig.IsAuthorized(session, session.GetOAuthTokens(provider), request))
            {
                if (generateNewCookies)
                {
                    this.Request.GenerateNewSessionCookies(session);
                }

                response = oAuthConfig.Authenticate(this, session, request);
            }
            else
            {
                if (generateNewCookies)
                {
                    this.Request.GenerateNewSessionCookies(session);
                    this.Request.SaveSession(session);
                }
            }
            return(response);
        }
Exemplo n.º 49
0
        public AuthInterceptor(IAuthProvider authProvider)
        {
            Guard.WhenArgument(authProvider, "authProvider").IsNull().Throw();

            this.authProvider = authProvider;
        }
Exemplo n.º 50
0
 public HomeController(IRepository repository, IAuthProvider authProvider)
 {
     this.repository   = repository;
     this.authProvider = authProvider;
 }
 public HomeController(ILogger <HomeController> logger, IAuthProvider authProvider) : base(authProvider)
 {
     _logger = logger;
 }
Exemplo n.º 52
0
 public CrewController(IAuthProvider authParam, ICrewRepository repoCrew, IWhitelistRepository repoWhite,
                       ILogRepository repoLog)
 {
     RepoCrew  = repoCrew;
     RepoWhite = repoWhite;
 }
Exemplo n.º 53
0
 public AccountController(IKernel kernel, IAuthProvider auth)
 {
     authProvider = auth;
 }
Exemplo n.º 54
0
 public static bool IsAuthorizedSafe(this IAuthProvider authProvider, IAuthSession session, IAuthTokens tokens)
 {
     return(authProvider != null && authProvider.IsAuthorized(session, tokens));
 }
Exemplo n.º 55
0
 static SecurityManager()
 {
     _settings              = new Settings();
     _frontEndAuthProvider  = new FrontEndAuthProvider(_settings);
     _localhostAuthProvider = new LocalhostAuthProvider(_settings);
 }
Exemplo n.º 56
0
 public HomeController(IRecipeDAO recipeDAO, IAuthProvider authProvider) : base(authProvider)
 {
     this.recipeDAO = recipeDAO;
 }
Exemplo n.º 57
0
 public AccountController(IAuthProvider auth, IUserRepository userRepository, IFirmaRepository firmaRepository)
 {
     this._authProvider    = auth;
     this._userRepository  = userRepository;
     this._firmaRepository = firmaRepository;
 }
Exemplo n.º 58
0
 public AccountController(IRepository <User> users, IAuthProvider auth)
 {
     usersRepository = users;
     authprovider    = auth;
 }
Exemplo n.º 59
0
 /// <summary>
 ///  Use the specified AuthProvider when connecting to Cassandra hosts. <p> Use
 ///  this method when a custom authentication scheme is in place. You shouldn't
 ///  call both this method and {@code withCredentials}' on the same
 ///  <c>Builder</c> instance as one will supersede the other</p>
 /// </summary>
 /// <param name="authProvider"> the <link>AuthProvider"></link> to use to login to Cassandra hosts.</param>
 /// <returns>this Builder</returns>
 public Builder WithAuthProvider(IAuthProvider authProvider)
 {
     _authProvider = authProvider;
     return(this);
 }
Exemplo n.º 60
0
 public AccountController(IAuthProvider auth)
 {
     authProvider = auth;
 }