public override IWebAuthResponse OnAuthorization(HttpContextBase httpContext, IEnumerable <AuthorizeGroupAttribute> groupAuthorizations) { IHttpRequestHelper requestHelper = GetRequestHelper(httpContext); bool HasGroupAuthorization = groupAuthorizations.All(auth => auth.IsAuthorized(requestHelper.User)); bool HasSiteAuthorization = requestHelper.Application.ConfigurationService.FederatedIPAuthentication.Mode == FederatedAuth.FederatedIPAuthenticationMode.Consumer && requestHelper.User.Sites.Any() ? requestHelper.User.Sites.Contains(requestHelper.Application.ConfigurationService.FederatedIPAuthentication.ApplicationId) : true; return(HasGroupAuthorization && HasSiteAuthorization?WebAuthResponse.Ok() : WebAuthResponse.Unauthorized()); }
public override IWebAuthResponse OnAuthentication(HttpContextBase httpContext, bool authenticationRequired) { IHttpRequestHelper requestHelper = GetRequestHelper(httpContext); if (authenticationRequired) { bool HasSiteAuthorization = requestHelper.Application.ConfigurationService.FederatedIPAuthentication.Mode == FederatedAuth.FederatedIPAuthenticationMode.Consumer && requestHelper.User.Sites.Any() ? requestHelper.User.Sites.Contains(requestHelper.Application.ConfigurationService.FederatedIPAuthentication.ApplicationId) : true; if (requestHelper.IsAuthenticatedUser && HasSiteAuthorization) { requestHelper.HandleAuthenticatedRequest(UpdateUserData); return(WebAuthResponse.Ok()); } requestHelper.HandleForbiddenRequest(); return(WebAuthResponse.Forbidden()); } requestHelper.HandlePublicPageRequest(); return(WebAuthResponse.Ok()); }
public virtual IWebAuthResponse OnAuthorization(HttpContextBase httpContext, IEnumerable <AuthorizeGroupAttribute> groupAuthorizations) => WebAuthResponse.Ok();
public virtual IWebAuthResponse OnAuthentication(HttpContextBase httpContext, bool authenticationRequired) => WebAuthResponse.Ok();