public OAuthAuthenticationMiddleware(OwinMiddleware next, ILogger logger, IOAuthClientSettings settings,
                                      IClaimProcessor claimProcessor, IOAuthHelper oauthHelper) : base(next)
 {
     Logger = logger;
     OAuthClientSettings = settings;
     ClaimProcessor      = claimProcessor;
     OAuthHelper         = oauthHelper;
 }
示例#2
0
 public AuthenticationHub(IMediator mediator, ILogger logger, IMappingService mappingService,
                          IRequestDispatchingProxy requestDispatchingProxy, IOAuthClientService service,
                          IAuthenticationApi authenticationApi, IOAuthHelper oauthHelper = null)
     : base(mediator, logger, mappingService, requestDispatchingProxy, oauthHelper)
 {
     _service           = service;
     _authenticationApi = authenticationApi;
 }
        public OAuthAuthorizeAttribute(string roles  = null, string users  = null, string process = null,
                                       string target = null, bool isDenied = false)
        {
            Roles    = roles;
            Users    = users;
            Process  = process;
            Target   = target;
            IsDenied = isDenied;

            Logger      = Logger ?? GlobalDependencyResolver.Default.ResolveRequiredDependency <ILogger>();
            OAuthHelper = OAuthHelper ?? GlobalDependencyResolver.Default.ResolveRequiredDependency <IOAuthHelper>();
            Serializer  = Serializer ?? GlobalDependencyResolver.Default.Resolve <ISerializer>();

            AuthorizationService = AuthorizationService ??
                                   GlobalDependencyResolver.Default.ResolveRequiredDependency <IAuthorizationService>();
        }
示例#4
0
        protected MediatedHubBase(IMediator mediator, ILogger logger, IMappingService mappingService,
                                  IRequestDispatchingProxy requestDispatchingProxy, IOAuthHelper oauthHelper = null)
        {
            InstanceKey             = Guid.NewGuid();
            Logger                  = logger;
            MappingService          = mappingService;
            RequestDispatchingProxy = requestDispatchingProxy;
            OAuthHelper             = oauthHelper;

            if (mediator == null)
            {
                mediator = Mediator.Default;
            }

            mediator.RegisterAllHandlers(this);
        }
示例#5
0
        public AuthorizeWithCookiesAttribute(string roles  = null, string users  = null, string process        = null,
                                             string target = null, bool isDenied = false, bool getUserInfoOnly = false)
        {
            Roles           = roles;
            Users           = users;
            Process         = process;
            Target          = target;
            IsDenied        = isDenied;
            GetUserInfoOnly = getUserInfoOnly;

            Logger      = Logger ?? GlobalDependencyResolver.Default.ResolveRequiredDependency <ILogger>();
            OAuthHelper = OAuthHelper ?? GlobalDependencyResolver.Default.ResolveRequiredDependency <IOAuthHelper>();
            Serializer  = Serializer ?? GlobalDependencyResolver.Default.ResolveRequiredDependency <ISerializer>();

            OAuthClientSettings = OAuthClientSettings ?? GlobalDependencyResolver.Default.ResolveRequiredDependency <IOAuthClientSettings>();
            ClaimProcessor      = ClaimProcessor ?? GlobalDependencyResolver.Default
                                  .ResolveRequiredDependency <IClaimProcessor>();
            WebAuthenticationSettings = WebAuthenticationSettings ??
                                        GlobalDependencyResolver.Default
                                        .ResolveRequiredDependency <IWebAuthenticationSettings>();

            AuthorizationService = AuthorizationService ??
                                   GlobalDependencyResolver.Default.ResolveRequiredDependency <IAuthorizationService>();
        }
示例#6
0
 public TrialHub(IMediator mediator, ILogger logger, IMappingService mappingService,
                 IRequestDispatchingProxy requestDispatchingProxy, IOAuthHelper oauthHelper = null)
     : base(mediator, logger, mappingService, requestDispatchingProxy, oauthHelper)
 {
 }
 public OAuthAuthentication(IAuthClient <T> client, IOAuthHelper helper)
 {
     this.client = client ?? throw new ArgumentNullException(nameof(client));
     this.helper = helper ?? throw new ArgumentNullException(nameof(helper));
 }
 public TwitterService(IOAuthHelper authHelper, IHttpService httpService, IOptions <WebSettings> options)
 {
     this.authHelper  = authHelper;
     this.httpService = httpService;
     this.options     = options.Value;
 }
示例#9
0
 public OAuthClient()
 {
     oauthHelper = new OAuthHelper();
 }