Пример #1
0
 public OAuthHelper(IOAuthClientSettings settings, IInProcessCache inProcessCache,
                    IClaimProcessor claimProcessor)
 {
     Settings       = settings;
     InProcessCache = inProcessCache;
     ClaimProcessor = claimProcessor ?? new StraightThroughClaimProcessor();
 }
 public OAuthAuthenticationMiddleware(OwinMiddleware next, ILogger logger, IOAuthClientSettings settings,
                                      IClaimProcessor claimProcessor, IOAuthHelper oauthHelper) : base(next)
 {
     Logger = logger;
     OAuthClientSettings = settings;
     ClaimProcessor      = claimProcessor;
     OAuthHelper         = oauthHelper;
 }
Пример #3
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>();
        }