Class JAXRPCRequestFilter
- java.lang.Object
-
- com.sun.identity.jaxrpc.JAXRPCRequestFilter
-
- All Implemented Interfaces:
jakarta.servlet.Filter
public class JAXRPCRequestFilter extends Object implements jakarta.servlet.Filter
Servlet filter for the/jaxrpc/*endpoints.The stock JAX-RPC servlet does not expose the incoming
HttpServletRequestto the service implementations. This filter captures the current request in a thread local so that individual JAXRPC methods can read the caller's SSO token from the request cookie when they need to authenticate the caller (e.g. the notification-URL registration methods, to prevent unauthenticated stored SSRF - GHSA-w858-46wv-v45w).The filter itself never rejects a request (the per-method
read/create/modifycalls carry their token as an explicit argument and must keep working); authorization is enforced per-method viaisServerOrAgentAuthorized().
-
-
Field Summary
Fields Modifier and Type Field Description static StringSKIP_AUTH_CHECKWhen set totrue, the caller check performed byisServerOrAgentAuthorized()is skipped.
-
Constructor Summary
Constructors Constructor Description JAXRPCRequestFilter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()voiddoFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain)static jakarta.servlet.http.HttpServletRequestgetCurrentRequest()voidinit(jakarta.servlet.FilterConfig filterConfig)static booleanisServerOrAgentAuthorized()Authorizes the current JAXRPC caller for notification-URL registration.
-
-
-
Field Detail
-
SKIP_AUTH_CHECK
public static final String SKIP_AUTH_CHECK
When set totrue, the caller check performed byisServerOrAgentAuthorized()is skipped. Runtime toggle - lets legacy clients that do not send an SSO cookie keep registering notification URLs without a rebuild.- See Also:
- Constant Field Values
-
-
Method Detail
-
getCurrentRequest
public static jakarta.servlet.http.HttpServletRequest getCurrentRequest()
- Returns:
- the
HttpServletRequestcurrently being processed on this thread by the/jaxrpc/*servlet, ornullif there is none.
-
isServerOrAgentAuthorized
public static boolean isServerOrAgentAuthorized()
Authorizes the current JAXRPC caller for notification-URL registration.The caller is authorized when it presents (via the request cookie) a valid SSO token that belongs to a server (an admin/application token) or an agent (an
SessionType.APPLICATIONsession). Regular user tokens and anonymous callers are rejected. The check is skipped entirely when theSKIP_AUTH_CHECKsystem property istrue.- Returns:
trueif the caller is allowed to register/deregister notification URLs.
-
init
public void init(jakarta.servlet.FilterConfig filterConfig) throws jakarta.servlet.ServletException- Specified by:
initin interfacejakarta.servlet.Filter- Throws:
jakarta.servlet.ServletException
-
doFilter
public void doFilter(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException- Specified by:
doFilterin interfacejakarta.servlet.Filter- Throws:
IOExceptionjakarta.servlet.ServletException
-
destroy
public void destroy()
- Specified by:
destroyin interfacejakarta.servlet.Filter
-
-