public VariableManifestFactory(ILog log, IDeploymentManifestFactory deploymentManifestFactory, IWebPortalConfigurationStore webPortalConfigurationStore, IRelationalStore store)
 {
     _log = log;
     _deploymentManifestFactory   = deploymentManifestFactory;
     _webPortalConfigurationStore = webPortalConfigurationStore;
     _store = store;
 }
 public GoogleAppsUserAuthenticationAction(
     ILog log,
     IGoogleAppsConfigurationStore configurationStore,
     IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer,
     IGoogleAppsAuthorizationEndpointUrlBuilder urlBuilder,
     IApiActionResponseCreator responseCreator,
     IApiActionModelBinder modelBinder,
     IWebPortalConfigurationStore webPortalConfigurationStore) : base(log, configurationStore, identityProviderConfigDiscoverer, urlBuilder, responseCreator, modelBinder, webPortalConfigurationStore)
 {
 }
 protected UserAuthenticationAction(
     ILog log,
     TStore configurationStore,
     IIdentityProviderConfigDiscoverer identityProviderConfigDiscoverer,
     IAuthorizationEndpointUrlBuilder urlBuilder,
     IApiActionResponseCreator responseCreator,
     IApiActionModelBinder modelBinder,
     IWebPortalConfigurationStore webPortalConfigurationStore)
 {
     this.log         = log;
     ResponseCreator  = responseCreator;
     this.modelBinder = modelBinder;
     this.webPortalConfigurationStore = webPortalConfigurationStore;
     ConfigurationStore = configurationStore;
     this.identityProviderConfigDiscoverer = identityProviderConfigDiscoverer;
     this.urlBuilder = urlBuilder;
 }
 protected OpenIdConnectConfigureCommands(ILog log, Lazy <TStore> configurationStore, IWebPortalConfigurationStore webPortalConfigurationStore)
 {
     Log = log;
     ConfigurationStore = configurationStore;
     this.webPortalConfigurationStore = webPortalConfigurationStore;
 }
Example #5
0
        public IntegratedAuthenticationModule(ILog log, IAuthCookieCreator tokenIssuer, IApiActionResponseCreator responseCreator, IWebPortalConfigurationStore webPortalConfigurationStore)
        {
            Get[DirectoryServicesConstants.ChallengePath] = c =>
            {
                if (Context.CurrentUser == null)
                {
                    return(responseCreator.Unauthorized(Request));
                }

                var principal   = (IOctopusPrincipal)Context.CurrentUser;
                var authCookies = tokenIssuer.CreateAuthCookies(Context.Request, principal.IdentificationToken, SessionExpiry.TwentyMinutes);

                var      whitelist = webPortalConfigurationStore.GetTrustedRedirectUrls();
                Response response;
                if (Request.Query["redirectTo"].HasValue && Requests.IsLocalUrl(Request.Query["redirectTo"].Value, whitelist))
                {
                    var redirectLocation = Request.Query["redirectTo"].Value;
                    response = new RedirectResponse(redirectLocation).WithCookies(authCookies);
                }
                else
                {
                    if (Request.Query["redirectTo"].HasValue)
                    {
                        log.WarnFormat("Prevented potential Open Redirection attack on an NTLM challenge, to the non-local url {0}", Request.Query["redirectTo"].Value);
                    }

                    response = new RedirectResponse(Request.Url.BasePath ?? "/").WithCookies(authCookies);
                }

                return(response);
            };
        }
Example #6
0
 public GoogleAppsConfigureCommands(ILog log, Lazy <IGoogleAppsConfigurationStore> configurationStore, IWebPortalConfigurationStore webPortalConfigurationStore) : base(log, configurationStore, webPortalConfigurationStore)
 {
 }
 public AzureADConfigureCommands(ILog log, Lazy <IAzureADConfigurationStore> configurationStore, IWebPortalConfigurationStore webPortalConfigurationStore) : base(log, configurationStore, webPortalConfigurationStore)
 {
 }
Example #8
0
        public IntegratedAuthenticationModule(ILog log, IAuthCookieCreator tokenIssuer, IApiActionResponseCreator responseCreator, IWebPortalConfigurationStore webPortalConfigurationStore)
        {
            Get[DirectoryServicesConstants.ChallengePath] = c =>
            {
                if (Context.CurrentUser == null)
                {
                    return(responseCreator.Unauthorized(Request));
                }

                var principal   = (IOctopusPrincipal)Context.CurrentUser;
                var tokenCookie = tokenIssuer.CreateAuthCookie(Context, principal.IdentificationToken, false);

                var directoryPathResult = Request.AbsoluteVirtualDirectoryPath();
                if (!directoryPathResult.IsValid)
                {
                    return(responseCreator.BadRequest(directoryPathResult.InvalidReason));
                }

                var      whitelist = webPortalConfigurationStore.GetTrustedRedirectUrls();
                Response response;
                if (Request.Query["redirectTo"].HasValue && Requests.IsLocalUrl(directoryPathResult.Path, Request.Query["redirectTo"].Value, whitelist))
                {
                    var redirectLocation = Request.Query["redirectTo"].Value;
                    response = new RedirectResponse(redirectLocation).WithCookie(tokenCookie);
                }
                else
                {
                    log.WarnFormat("Prevented potential Open Redirection attack on an NTLM challenge from the local instance {0} to the non-local url {1}", directoryPathResult.Path, Request.Query["redirectTo"].Value);
                    response = new RedirectResponse(directoryPathResult.Path ?? "/").WithCookie(tokenCookie);
                }

                return(response);
            };
        }