public ExternalAuthenticationGrant(
            UserManager <ApplicationUser> userManager,
            IUnitOfWork <DatabaseContext> unitOfWork,
            IExternalUserRepository externalUserRepository,
            IProviderRepository providerRepository,
            IFacebookAuthProvider facebookAuthProvider,
            IGoogleAuthProvider googleAuthProvider,
            ITwitterAuthProvider twitterAuthProvider,
            ILinkedInAuthProvider linkeInAuthProvider,
            INonEmailUserProcessor nonEmailUserProcessor,
            IEmailUserProcessor emailUserProcessor
            )
        {
            _userManager            = userManager ?? throw new ArgumentNullException(nameof(userManager));
            _unitOfWork             = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork));
            _externalUserRepository = externalUserRepository ?? throw new ArgumentNullException(nameof(externalUserRepository));
            _providerRepository     = providerRepository ?? throw new ArgumentNullException(nameof(providerRepository));
            _facebookAuthProvider   = facebookAuthProvider ?? throw new ArgumentNullException(nameof(facebookAuthProvider));
            _googleAuthProvider     = googleAuthProvider ?? throw new ArgumentNullException(nameof(googleAuthProvider));
            _twitterAuthProvider    = twitterAuthProvider ?? throw new ArgumentNullException(nameof(twitterAuthProvider));
            _linkedAuthProvider     = linkeInAuthProvider ?? throw new ArgumentNullException(nameof(linkeInAuthProvider));
            _nonEmailUserProcessor  = nonEmailUserProcessor ?? throw new ArgumentNullException(nameof(nonEmailUserProcessor));
            _emailUserProcessor     = emailUserProcessor ?? throw new ArgumentNullException(nameof(nonEmailUserProcessor));

            providers = new Dictionary <ProviderType, IExternalAuthProvider>();
            providers.Add(ProviderType.Facebook, _facebookAuthProvider);
            providers.Add(ProviderType.Google, _googleAuthProvider);
            providers.Add(ProviderType.Twitter, _twitterAuthProvider);
            providers.Add(ProviderType.LinkedIn, _linkedAuthProvider);
        }
示例#2
0
        public ExternalAuthenticationGrant(
            UserManager <TUser> userManager,
            IProviderRepository providerRepository,
            IFacebookAuthProvider facebookAuthProvider,
            IGoogleAuthProvider googleAuthProvider,
            ITwitterAuthProvider twitterAuthProvider,
            ILinkedInAuthProvider linkeInAuthProvider,
            INonEmailUserProcessor nonEmailUserProcessor,
            IEmailUserProcessor emailUserProcessor
            )
        {
            _userManager           = userManager ?? throw new ArgumentNullException(nameof(userManager));
            _providerRepository    = providerRepository ?? throw new ArgumentNullException(nameof(providerRepository));
            _facebookAuthProvider  = facebookAuthProvider ?? throw new ArgumentNullException(nameof(facebookAuthProvider));
            _googleAuthProvider    = googleAuthProvider ?? throw new ArgumentNullException(nameof(googleAuthProvider));
            _twitterAuthProvider   = twitterAuthProvider ?? throw new ArgumentNullException(nameof(twitterAuthProvider));
            _linkedAuthProvider    = linkeInAuthProvider ?? throw new ArgumentNullException(nameof(linkeInAuthProvider));
            _nonEmailUserProcessor = nonEmailUserProcessor ?? throw new ArgumentNullException(nameof(nonEmailUserProcessor));
            _emailUserProcessor    = emailUserProcessor ?? throw new ArgumentNullException(nameof(nonEmailUserProcessor));

            _providers = new Dictionary <ProviderType, IExternalAuthProvider>
            {
                { ProviderType.Facebook, _facebookAuthProvider },
                { ProviderType.Google, _googleAuthProvider },
                { ProviderType.Twitter, _twitterAuthProvider },
                { ProviderType.LinkedIn, _linkedAuthProvider }
            };
        }
 public CustomExternalGrantValidator(
     UserManager <AppUser> userManager,
     SignInManager <AppUser> signInManager,
     INonEmailUserProcessor nonEmailUserProcessor,
     IEmailUserProcessor emailUserProcessor
     )
 {
     _userManager           = userManager;
     _signInManager         = signInManager;
     _nonEmailUserProcessor = nonEmailUserProcessor;
     _emailUserProcessor    = emailUserProcessor;
 }
 public ExternalAuthenticationGrant(
     Func <string, IExternalTokenProvider> tokenServiceAccessor,
     IUserManager userManager,
     IEmailUserProcessor emailUserProcessor,
     INonEmailUserProcessor nonEmailUserProcessor
     )
 {
     _tokenServiceAccessor  = tokenServiceAccessor ?? throw new ArgumentNullException(nameof(tokenServiceAccessor));
     _userManager           = userManager ?? throw new ArgumentNullException(nameof(userManager));
     _emailUserProcessor    = emailUserProcessor ?? throw new ArgumentNullException(nameof(emailUserProcessor));
     _nonEmailUserProcessor = nonEmailUserProcessor ?? throw new ArgumentNullException(nameof(nonEmailUserProcessor));
 }
示例#5
0
 public ExternalAuthenticationGrant(
     ITokenExchangeProviderStore providerStore,
     Func <string, IExternalTokenProvider> tokenServiceAccessor,
     IExternalUserStore externalUserStore,
     IEmailUserProcessor emailUserProcessor,
     INonEmailUserProcessor nonEmailUserProcessor
     )
 {
     _providerStore         = providerStore ?? throw new ArgumentNullException(nameof(providerStore));
     _tokenServiceAccessor  = tokenServiceAccessor ?? throw new ArgumentNullException(nameof(tokenServiceAccessor));
     _externalUserStore     = externalUserStore ?? throw new ArgumentNullException(nameof(externalUserStore));
     _emailUserProcessor    = emailUserProcessor ?? throw new ArgumentNullException(nameof(emailUserProcessor));
     _nonEmailUserProcessor = nonEmailUserProcessor ?? throw new ArgumentNullException(nameof(nonEmailUserProcessor));
 }