Class WebUiSession.CsrfWebUiSessionAccessControl
java.lang.Object
com.inductiveautomation.ignition.gateway.dataroutes.AbstractAccessControlStrategy
com.inductiveautomation.ignition.gateway.dataroutes.AbstractGatewayAccessControlStrategy
com.inductiveautomation.ignition.gateway.web.session.WebUiSession.WebUiSessionAccessControl
com.inductiveautomation.ignition.gateway.web.session.WebUiSession.CsrfWebUiSessionAccessControl
- All Implemented Interfaces:
AccessControlStrategy
- Enclosing interface:
- WebUiSession
public static class WebUiSession.CsrfWebUiSessionAccessControl
extends WebUiSession.WebUiSessionAccessControl
A
WebUiSession.WebUiSessionAccessControl which requires that each request furnish a valid CSRF token.
Note: by default, this strategy can only be mounted with Routes which use an unsafe HTTP method such as POST, PUT, PATCH, or DELETE.
-
Field Summary
Fields inherited from class com.inductiveautomation.ignition.gateway.dataroutes.AbstractGatewayAccessControlStrategy
permissionTypeFields inherited from class com.inductiveautomation.ignition.gateway.dataroutes.AbstractAccessControlStrategy
EMPTY_SECURITY_LEVELSFields inherited from interface com.inductiveautomation.ignition.gateway.dataroutes.AccessControlStrategy
OPEN_ROUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncanAccess(RequestContext request) Determines whether the request should be allowed to proceed.protected RouteAccesscanAccessInternal(RequestContext request) Internal method called bycanAccess(RequestContext)ifAbstractAccessControlStrategy.canAccess(RequestContext)returnsRouteAccess.GRANTED.voidvalidate(RouteMounterContext routeMounterContext) Only unsafe HTTP methods are allowed by default since it is usually the intention that unsafe HTTP methods are used for state changing operations and this strategy requires requests to furnish valid CSRF tokens to protect against CSRF attacks, but most clients will not send a CSRF token unless the HTTP method is unsafeMethods inherited from class com.inductiveautomation.ignition.gateway.web.session.WebUiSession.WebUiSessionAccessControl
getActor, getSecurityLevels, getWebAuthUserMethods inherited from class com.inductiveautomation.ignition.gateway.dataroutes.AbstractGatewayAccessControlStrategy
getRequiredPermissions, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.inductiveautomation.ignition.gateway.dataroutes.AccessControlStrategy
getWwwAuthenticateHeader
-
Constructor Details
-
CsrfWebUiSessionAccessControl
-
-
Method Details
-
canAccessInternal
Internal method called bycanAccess(RequestContext)ifAbstractAccessControlStrategy.canAccess(RequestContext)returnsRouteAccess.GRANTED. This method checks if the request has a valid CSRF token and if so, returnsRouteAccess.GRANTED, otherwise returnsRouteAccess.FORBIDDEN. This method may be overridden if CSRF checks should be conditioned upon some other properties of the request in special circumstances.- Parameters:
request- theRequestContext- Returns:
RouteAccess.GRANTEDif the request contains a valid CSRF token orRouteAccess.FORBIDDENif the request does not contain a valid CSRF token
-
canAccess
Description copied from interface:AccessControlStrategyDetermines whether the request should be allowed to proceed.- Specified by:
canAccessin interfaceAccessControlStrategy- Overrides:
canAccessin classAbstractAccessControlStrategy
-
validate
public void validate(RouteMounterContext routeMounterContext) throws RouteMounterValidationException Only unsafe HTTP methods are allowed by default since it is usually the intention that unsafe HTTP methods are used for state changing operations and this strategy requires requests to furnish valid CSRF tokens to protect against CSRF attacks, but most clients will not send a CSRF token unless the HTTP method is unsafe- Specified by:
validatein interfaceAccessControlStrategy- Overrides:
validatein classWebUiSession.WebUiSessionAccessControl- Parameters:
routeMounterContext- theRouteMounterContextto validate- Throws:
RouteMounterValidationException- if validation fails
-