Exemplo n.º 1
0
 //Highrise.Api _highrise;
 public ShopifyController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
     _orders = new Orders();
     _items = new OrderItems();
     //_highrise = new Highrise.Api("XYZ", "your_domain");
 }
 public ApplicationController(ITokenHandler tokenStore, ILogger logger)
 {
     TokenStore = tokenStore;
     Logger = logger;
     //initialize this
     //ViewBag.CurrentUser = CurrentUser ?? new {Email = ""};
 }
Exemplo n.º 3
0
        public ApplicationController(ITokenHandler tokenStore) {
            TokenStore = tokenStore;
            Logger = new NLogger();
            //initialize this
            ViewBag.CurrentUser = CurrentUser ?? new { Email = "" };

        }
Exemplo n.º 4
0
            public TokenEvaluator(ITokenHandler tokenHandler)
            {
                if (tokenHandler == null)
                {
                    throw new ArgumentNullException("tokenHandler");
                }

                _tokenHandler = tokenHandler;
            }
Exemplo n.º 5
0
 public AuthUser(ILoginRepository loginRepository, IUserRepository userRepository,
                 ISubscriptionRepository subscriptionRepository, ITokenHandler tokenHandler,
                 ISubscriptionTypeRepository subscriptionTypeRepository, CredentialsInput credentialsInput)
 {
     this.loginRepository            = loginRepository;
     this.userRepository             = userRepository;
     this.subscriptionRepository     = subscriptionRepository;
     this.tokenHandler               = tokenHandler;
     CredentialsInput                = credentialsInput;
     this.subscriptionTypeRepository = subscriptionTypeRepository;
 }
Exemplo n.º 6
0
 public AuthenticationManager(IUserManagerWrapper userManager, ISignInManagerWrapper signInManager, IMapper mapper, IEmployerHandler employerHandler, ITokenHandler tokenHandler, IHttpContextAccessor httpContextAccessor, IDataProtectionProvider dataProtectionProvider, IConfiguration configuration)
 {
     _userManager            = userManager ?? throw new ArgumentNullException(nameof(_userManager));
     _signInManager          = signInManager ?? throw new ArgumentNullException(nameof(_signInManager));
     _mapper                 = mapper ?? throw new ArgumentNullException(nameof(_mapper));
     _employerHandler        = employerHandler ?? throw new ArgumentNullException(nameof(_employerHandler));
     _tokenHandler           = tokenHandler ?? throw new ArgumentNullException(nameof(_tokenHandler));
     _httpContextAccessor    = httpContextAccessor ?? throw new ArgumentNullException(nameof(_httpContextAccessor));
     _dataProtectionProvider = dataProtectionProvider ?? throw new ArgumentNullException(nameof(_dataProtectionProvider));
     _configuration          = configuration ?? throw new ArgumentNullException(nameof(_configuration));
 }
Exemplo n.º 7
0
 public AuthService(
     DataContext context,
     IPasswordHasher passwordHasher,
     ITokenHandler tokenHandler,
     IOptions <AppSettings> appSettings
     )
 {
     _context        = context;
     _passwordHasher = passwordHasher;
     _tokenHandler   = tokenHandler;
     _appSettings    = appSettings.Value;
 }
 public AuthenticationService(
     IUserService userService,
     ITokenHandler tokenHandler,
     IOptions <CustomTokenOptions> tokenOptions,
     UserManager <AppUser> userManager,
     SignInManager <AppUser> signInManager,
     RoleManager <AppRole> roleManager
     ) : base(userManager, signInManager, roleManager)
 {
     this.tokenHandler = tokenHandler;
     this.userService  = userService;
     this.tokenOptions = tokenOptions.Value;
 }
Exemplo n.º 9
0
 public IdentityService(UserManager <ApplicationUser> userManager, RoleManager <ApplicationRole> roleManger, IHasher hasher, ITokenHandler tokenHandler, IMessagerService messager, IStringLocalizer <SharedResources> localizer, IUnitOfWork unitOfWork, IUserDetectionService userDetectionService, IMapper mapper, IHostEnvironment _environment, ILogger <IdentityService> logger)
 {
     this.userManager          = userManager;
     this.roleManger           = roleManger;
     this.hasher               = hasher;
     this.tokenHandler         = tokenHandler;
     this.messager             = messager;
     this.localizer            = localizer;
     this.unitOfWork           = unitOfWork;
     this.userDetectionService = userDetectionService;
     this.mapper               = mapper;
     this.environment          = _environment;
     this.logger               = logger;
 }
Exemplo n.º 10
0
 public UserTestsWindowViewModel(IRegionManager regionManager, ITokenHandler tokenHandler) : base(regionManager)
 {
     AllUsersFilter                  = "";
     TestFilter                      = "";
     AllowedUsersFilter              = "";
     AllowedUsers                    = new ObservableCollection <string>();
     _tokenHandler                   = tokenHandler;
     DeleteTestButtonCommand         = new DelegateCommand <object>(async(object test) => await DeleteTestButton(test));
     UpdateAllowedUsersButtonCommand = new DelegateCommand(async() => await UpdateAllowedUsersButton());
     AddAllowedUsersButtonCommand    = new DelegateCommand <object>(async(object test) => await AddAllowedUsersButton(test));
     DeleteAllowedUsersButtonCommand = new DelegateCommand <object>(async(object test) => await DeleteAllowedUsersButton(test));
     EditTestButtonCommand           = new DelegateCommand <object>(EditTestButton);
     ShowUsersResultsButtonCommand   = new DelegateCommand <object>(ShowUsersResultsButton);
     ReturnButtonCommand             = new DelegateCommand(ReturnButton);
 }
Exemplo n.º 11
0
            public bool IsValid(string token)
            {
                if (!_tokenHandlers.Any())
                {
                    return(false);
                }

                var currentToken = _tokenHandlers.Peek();

                if (currentToken == null || !currentToken.IsValid(token))
                {
                    return(false);
                }

                _tokenHandler = _tokenHandlers.Dequeue();

                return(true);
            }
Exemplo n.º 12
0
        public EmailHandler(IConfiguration config, IResourcesHelper resourcesHelper, ITokenHandler tokenHandler)
        {
            _configuration   = config;
            _resourcesHelper = resourcesHelper;
            _tokenHandler    = tokenHandler;

            hostEmail     = _configuration["AppSettings:HostEmail"];
            portEmail     = _configuration["AppSettings:PortEmail"];
            userNameEmail = _configuration["AppSettings:UsernameEmail"];
            passwordEmail = _configuration["AppSettings:PasswordEmail"];

            noReplyEmail = _configuration["AppSettings:NoReplayEmail"];

            smtpClient = new SmtpClient(this.hostEmail, Convert.ToInt32(this.portEmail))
            {
                Credentials = new NetworkCredential(this.userNameEmail, this.passwordEmail),
                EnableSsl   = true,
            };
        }
Exemplo n.º 13
0
 public EditTestWindowViewModel(IRegionManager regionManager, ITokenHandler tokenHandler) : base(regionManager)
 {
     _tokenHandler                  = tokenHandler;
     AddQuestionButtonCommand       = new DelegateCommand(AddQuestionButton);
     AddAnswerButtonCommand         = new DelegateCommand <object>(AddAnswerButton);
     RemoveQuestionButtonCommand    = new DelegateCommand <object>(RemoveQuestionButton);
     RemoveAnswerButtonCommand      = new DelegateCommand <object>(RemoveAnswerButton);
     ReturnButtonCommand            = new DelegateCommand(ReturnButton);
     RemoveAnswerEnterButtonCommand = new DelegateCommand <object>(RemoveAnswerEnterButton);
     CreateTestButtonCommand        = new DelegateCommand(async() => await CreateTestButton());
     Test = new Test(LocalizationService.GetLocalizedValue <string>("NewTest"), StaticProperties.CurrentUserResponseHeader.Username, 0, new ObservableCollection <TestQuestion>());
     NumbersOfAttempts = new ObservableCollection <int>();
     for (int i = 1; i < 6; i++)
     {
         NumbersOfAttempts.Add(i);
     }
     Test.Questions.Add(new TestQuestion(LocalizationService.GetLocalizedValue <string>("Question"), new ObservableCollection <TestAnswer>()));
     IsTestEditing = true;
 }
        public override Task <ProviderCultureResult> DetermineProviderCultureResult(HttpContext httpContext)
        {
            if (httpContext == null)
            {
                throw new ArgumentNullException(nameof(httpContext));
            }

            _tokenHandler = GetService <ITokenHandler>(httpContext);                                   //? haven't better way?
            _logger       = GetService <ILogger <UserPreferenceRequestCultureProvider> >(httpContext); //? haven't better way?

            _logger.LogInformation("init searching language preference");

            var headers = httpContext.Request.GetTypedHeaders().Headers[HeaderName].AsEnumerable()?.ToList();

            if (headers == null || headers.Count == 0 || !headers[0].Contains(TokenType, StringComparison.InvariantCultureIgnoreCase))
            {
                _logger.LogInformation("no authorization: stop searching language preference");
                return(NullProviderCultureResult);
            }

            var accessToken = headers[0].Replace(TokenType, "").Trim();

            var claims = _tokenHandler.GetClaimsFromToken(accessToken);

            if (claims.IsNullOrEmpty())
            {
                _logger.LogWarning("claims not found");
                return(NullProviderCultureResult);
            }

            var cultureName = claims.FirstOrDefault(c => c.Type == UserPreferenceParamName)?.Value;

            if (cultureName.IsNullOrWhiteSpace())
            {
                _logger.LogInformation("claims haven't language preference");
                return(NullProviderCultureResult);
            }

            _logger.LogInformation($"language preference found: {cultureName}");

            return(Task.FromResult(new ProviderCultureResult(cultureName)));
        }
Exemplo n.º 15
0
        public TokenAuthenticationHandler(
            IOptionsMonitor <TokenAuthenticationHandlerSchemeOptions> options,
            ILoggerFactory logger,
            UrlEncoder encoder,
            ISystemClock clock,
            IAuthenticationProviderApi authenticationProviderApi,
            IWebAppDomainFacade domainFacade,
            ITokenHandler tokenProvider,
            IConfiguration configuration)
            : base(options, logger, encoder, clock)
        {
            AuthenticationProviderApi = authenticationProviderApi;
            DomainFacade  = domainFacade;
            TokenProvider = tokenProvider;
            var tokenAuthSettings = configuration.GetSection("TokenAuthSettings");

            CookieName          = Options != null && !string.IsNullOrWhiteSpace(Options.CookieName) ? Options.CookieName :  tokenAuthSettings.GetValue <string>("CookieName");
            LogoutUrl           = Options != null && !string.IsNullOrWhiteSpace(Options.LogoutUrl) ? Options.LogoutUrl : tokenAuthSettings.GetValue <string>("LogoutUrl");
            EnableTestUserLogin = Options != null && Options.EnableTestUserLogin is bool enableTestUserLogin ? enableTestUserLogin : tokenAuthSettings.GetValue <bool>("EnableTestUserLogin");
        }
Exemplo n.º 16
0
 public AuthenticationService(
     UserManager <User> userManager,
     ITokenHandler tokenHandler,
     IOptions <JwtConfiguration> jwtConfig,
     IProfileManager profileManager,
     ApplicationDbContext context,
     IUrlHelper url,
     IEmailSender emailSender,
     ILogger <AuthenticationService> logger,
     IMapper mapper
     )
 {
     _userManager    = userManager;
     _tokenHandler   = tokenHandler;
     _profileManager = profileManager;
     _jwtConfig      = jwtConfig.Value;
     _context        = context;
     _sessionContext = _context.Sessions;
     _url            = url;
     _emailSender    = emailSender;
     _mapper         = mapper;
     _logger         = logger;
 }
Exemplo n.º 17
0
        public AccountController(
            ILogger<AccountController> logger,
            IStringLocalizer<AccountController> localizer,

            UserManager<UserAccount> userManager,
            SignInManager<UserAccount> signInManager,
            ITokenHandler tokenHandler,
            IConfiguration configuration,
            IAsyncRepository<UserProfile> profileRep,
            IAccountService accountService)
        {
            _logger = logger;
            _localizer = localizer;

            _userManager = userManager;
            _signInManager = signInManager;
            _tokenHandler = tokenHandler;
            _configuration = configuration;
            _profileRep = profileRep;
            _accountService = accountService;

            //? this.userManager.UserValidators.Add(...) - how add to global?
        }
Exemplo n.º 18
0
 public EpisodesController(ITokenHandler tokenStore) : base(tokenStore)
 {
     _episodes = new Episodes();
 }
Exemplo n.º 19
0
 public AuthenticationService(IUserService userService, IPasswordHasher passwordHasher, ITokenHandler tokenHandler)
 {
     _tokenHandler   = tokenHandler;
     _passwordHasher = passwordHasher;
     _userService    = userService;
 }
Exemplo n.º 20
0
 public WizdomClient(ITokenHandler tokenHandler, int licenseId = 0)
 {
     _wizdomLicenseId = licenseId;
     _tokenHandler    = tokenHandler;
 }
Exemplo n.º 21
0
 public CustomersController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
     _table = new Customers();
     ViewBag.Table = _table;
 }
Exemplo n.º 22
0
 public AccountController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
     _users = new Users();
     // this._tokenStore = tokenStore;
 }
Exemplo n.º 23
0
 public FlagReport(ITokenHandler token)
 {
     UsageDescription = token.ToUsageDescription();
     Description = token.Description;
 }
Exemplo n.º 24
0
 public MachineKeyCompatibilityDataFormat(ITokenHandler iTokenHandler)
     : base(iTokenHandler)
 {
 }
Exemplo n.º 25
0
 public ShopifyController(ITokenHandler tokenStore):base(tokenStore) {
     _orders = new Orders();
     _customers = new Customers();
 }
Exemplo n.º 26
0
 public ProductionsController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
     _table = new Productions();
     ViewBag.Table = _table;
 }
Exemplo n.º 27
0
 public RolesController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
     _table = new Roles();
     ViewBag.Table = _table;
 }
Exemplo n.º 28
0
 public ProductionsController(ITokenHandler tokenStore):base(tokenStore) {
     _productions = new Productions();
 }
Exemplo n.º 29
0
 public PostsController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
     _table = new Posts();
     ViewBag.Table = _table;
 }
Exemplo n.º 30
0
 public EpisodesController(ITokenHandler tokenStore):base(tokenStore) {
     _episodes = new Episodes();
 }
Exemplo n.º 31
0
 public TokenHandlerTests()
 {
     SetupMocks();
     _tokenHandler = new TokenHandler(_tokenOptions.Object, _signingConfigurations, _passwordHasher.Object);
 }
Exemplo n.º 32
0
 public VidpubController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
 }
Exemplo n.º 33
0
 public AnnualController(ITokenHandler tokenStore):base(tokenStore) {
 }
 public AuthenticationControllerTests()
 {
     _mockTokenHandler = Substitute.For <ITokenHandler>();;
     _mockMediator     = Substitute.For <IMediator>();
 }
Exemplo n.º 35
0
 public AnnualController(ITokenHandler tokenStore) : base(tokenStore)
 {
 }
Exemplo n.º 36
0
 public ApplicationController()
 {
     Logger     = new NLogger();
     TokenStore = new FormsAuthTokenStore();
 }
Exemplo n.º 37
0
 public AuthenticationService(IAccountService accountService, IPasswordHandler passwordHandler, ITokenHandler tokenHandler)
 {
     _tokenHandler    = tokenHandler;
     _passwordHandler = passwordHandler;
     _accountService  = accountService;
 }
Exemplo n.º 38
0
 public ApplicationController() {
     Logger = new NLogger();
     TokenStore = new FormsAuthTokenStore();
 }
Exemplo n.º 39
0
 public ShopifyController(ITokenHandler tokenStore, ILogger logger)
     : base(tokenStore,logger)
 {
     _orders = new Orders();
 }
Exemplo n.º 40
0
 public JournalController(DataContext context, ITokenHandler <JwtSecurityToken> jwtHandler)
 {
     _context    = context;
     _jwtHandler = jwtHandler;
 }
 public AuthenticationService(IUserService userService, ITokenHandler tokenHandler, IHttpContextAccessor httpContextAccessor)
 {
     this._tokenHandler        = tokenHandler;
     this._userService         = userService;
     this._httpContextAccessor = httpContextAccessor;
 }
Exemplo n.º 42
0
 public DetailsController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
 }
Exemplo n.º 43
0
 public UserService(IUserDataAccess userDataAccess, ITokenHandler tokenHandler)
 {
     _userDataAccess = userDataAccess;
     _tokenHandler   = tokenHandler;
 }
 public CustomersV2Controller(ITokenHandler tokenStore)
     : base(tokenStore)
 {
     _table = new UserModel();
     ViewBag.Table = _table;
 }
 public AuctionHouseService(HttpClient httpClient, ITokenHandler tokenHandler, string apiUrl)
 {
     _apiUrl       = apiUrl;
     _httpClient   = httpClient;
     _tokenHandler = tokenHandler;
 }
Exemplo n.º 46
0
 public AccountController(ITokenHandler tokenStore, IMembershipService membershipService, ISendMail sendMail)
 {
     _tokenStore = tokenStore;
     _membershipService = membershipService;
     _sendMail = sendMail;
 }
Exemplo n.º 47
0
 public LoginService(IUserService userService, IPasswordHasher passwordHasher, ITokenHandler tokenHandler)
 {
     _tokenHandler   = tokenHandler;
     _passwordHasher = passwordHasher;
     _userService    = userService;
 }
Exemplo n.º 48
0
 public SearchController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
 }
Exemplo n.º 49
0
		// ]NOCPP]

		/**
		 * The constructor.
		 * 
		 * @param tokenHandler
		 *            the handler for receiving tokens
		 */
		public Tokenizer(ITokenHandler tokenHandler)
		{
			this.TokenHandler = tokenHandler;
			// [NOCPP[
			this.newAttributesEachTime = false;
			// ]NOCPP]
			this.bmpChar = new char[1];
			this.astralChar = new char[2];
			this.tagName = null;
			this.attributeName = null;
			this.doctypeName = null;
			this.publicIdentifier = null;
			this.systemIdentifier = null;
			this.attributes = null;
		}
Exemplo n.º 50
0
 public AdminController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
 }
Exemplo n.º 51
0
 public AuthenticationService(IUserService userService, ITokenHandler tokenHandler)
 {
     this.userService  = userService;
     this.tokenHandler = tokenHandler;
 }
Exemplo n.º 52
0
 public ApplicationController(ITokenHandler tokenStore)
     : this(tokenStore, new NLogger("ApplicationController"))
 {
 }
Exemplo n.º 53
0
 public AuthenticationService(IUserService userService, ITokenHandler tokenHandler)
 {
     _userService  = userService;
     _tokenHandler = tokenHandler;
 }
Exemplo n.º 54
0
 public LogsController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
     _table = new Log();
     ViewBag.Table = _table;
 }
Exemplo n.º 55
0
 public PublicController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
 }
Exemplo n.º 56
0
		public Tokenizer(ITokenHandler tokenHandler, bool newAttributesEachTime)
		{
			this.TokenHandler = tokenHandler;
			this.newAttributesEachTime = newAttributesEachTime;
			this.bmpChar = new char[1];
			this.astralChar = new char[2];
			this.tagName = null;
			this.attributeName = null;
			this.doctypeName = null;
			this.publicIdentifier = null;
			this.systemIdentifier = null;
			this.attributes = null;
		}
Exemplo n.º 57
0
 public AccountController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
     //_users = new Users();
 }
Exemplo n.º 58
0
 public ResultsController(ITokenHandler tokenStore)
     : base(tokenStore)
 {
 }