Beispiel #1
0
 public UserService(IUserRepository repository, IUserSecurityRepository userSecurityRepository, IRoleRepository roleRepository, IAbiokaToken abiokaToken, ICurrentContext currentContext, IDTOMapper dtoMapper)
     : base(repository, dtoMapper)
 {
     this.userSecurityRepository = userSecurityRepository;
     this.roleRepository         = roleRepository;
     this.abiokaToken            = abiokaToken;
     this.currentContext         = currentContext;
 }
        public GoogleAuthService(IUserSecurityRepository userSecurityRepository, IRoleRepository roleRepository, IAbiokaToken abiokaToken, IConfigurationManager configurationManager, IHttpClient httpClient)
        {
            this.userSecurityRepository = userSecurityRepository;
            this.roleRepository         = roleRepository;
            this.abiokaToken            = abiokaToken;
            this.httpClient             = httpClient;

            clientId     = configurationManager.ReadAppSetting("GoogleClientId");
            clientSecret = configurationManager.ReadAppSetting("GoogleClientSecret");
        }
Beispiel #3
0
        /// <summary>
        /// Creates the token.
        /// </summary>
        /// <param name="abiokaToken">The abioka token.</param>
        public virtual void CreateToken(IAbiokaToken abiokaToken, string newProviderToken)
        {
            var userInfo = new UserClaim {
                Email         = Email,
                Id            = Id,
                Provider      = AuthProvider,
                ProviderToken = newProviderToken,
                Roles         = Roles?.Select(r => r.Name).ToArray(),
                RefreshToken  = RefreshToken,
                Language      = Language
            };

            var token = abiokaToken.Encode(userInfo);

            Token         = token;
            ProviderToken = newProviderToken;
        }
 public LocalAuthService(IUserSecurityRepository userSecurityRepository, IAbiokaToken abiokaToken)
 {
     this.userSecurityRepository = userSecurityRepository;
     this.abiokaToken            = abiokaToken;
 }
Beispiel #5
0
 public AuthenticationHandler(IAbiokaToken abiokaToken, ICurrentContext currentContext)
 {
     this.abiokaToken    = abiokaToken;
     this.currentContext = currentContext;
 }