Class XsrfProtectedServiceServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
com.google.gwt.user.server.rpc.jakarta.AbstractRemoteServiceServlet
com.google.gwt.user.server.rpc.jakarta.RemoteServiceServlet
com.google.gwt.user.server.rpc.jakarta.AbstractXsrfProtectedServiceServlet
com.google.gwt.user.server.rpc.jakarta.XsrfProtectedServiceServlet
- All Implemented Interfaces:
SerializationPolicyProvider
,jakarta.servlet.Servlet
,jakarta.servlet.ServletConfig
,Serializable
EXPERIMENTAL and subject to change. Do not use this in production code.
The servlet base class for RPC service implementations using default XSRF protection tied to authentication session cookie.
XSRF token validation is performed by generating MD5 hash of the session
cookie and comparing supplied XsrfToken
with the generated hash.
Session cookie name is specified by the "gwt.xsrf.session_cookie_name"
context parameter in web.xml
.
XsrfTokenService
can be used by
clients to obtain XsrfToken
s that will pass validation performed by
this class.
- See Also:
-
Field Summary
Fields inherited from class com.google.gwt.user.server.rpc.jakarta.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
-
Constructor Summary
ConstructorDescriptionXsrfProtectedServiceServlet
(Object delegate) XsrfProtectedServiceServlet
(Object delegate, String sessionCookieName) XsrfProtectedServiceServlet
(String sessionCookieName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
init()
protected void
validateXsrfToken
(RpcToken token, Method method) ValidatesXsrfToken
included withinvalid reference
RPCRequest
Methods inherited from class com.google.gwt.user.server.rpc.jakarta.AbstractXsrfProtectedServiceServlet
onAfterRequestDeserialized, shouldValidateXsrfToken
Methods inherited from class com.google.gwt.user.server.rpc.jakarta.RemoteServiceServlet
checkPermutationStrongName, doGetSerializationPolicy, getCodeServerPolicyUrl, getRequestModuleBasePath, getSerializationPolicy, init, loadPolicyFromCodeServer, loadSerializationPolicy, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processCall, processPost, shouldCompressResponse
Methods inherited from class com.google.gwt.user.server.rpc.jakarta.AbstractRemoteServiceServlet
doPost, doUnexpectedFailure, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, readContent
Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
-
Field Details
-
sessionCookieName
String sessionCookieName
-
-
Constructor Details
-
XsrfProtectedServiceServlet
public XsrfProtectedServiceServlet() -
XsrfProtectedServiceServlet
-
XsrfProtectedServiceServlet
-
XsrfProtectedServiceServlet
-
-
Method Details
-
init
public void init() throws jakarta.servlet.ServletException- Overrides:
init
in classjakarta.servlet.GenericServlet
- Throws:
jakarta.servlet.ServletException
-
validateXsrfToken
ValidatesXsrfToken
included withinvalid reference
RPCRequest
- Specified by:
validateXsrfToken
in classAbstractXsrfProtectedServiceServlet
- Parameters:
token
-RpcToken
included with an RPC request.method
- method being invoked via this RPC call.- Throws:
RpcTokenException
- if token verification failed.
-