Pawn2:Call Flow
From Adapt
Overview of basic call flow and authentication for server-side calls.
All GWT services must implement AuthorizationCheckRemoteServiceServlet. This handles checking to ensure that a client is authorized to use a call. Services must also implement the getAuthorizationEngine() call if their methods require any type of authorization beyond a client being logged in to PAWN.
Basic Call Flow
- Service is instantiated, constructor may call setContextRequired(false) if methods in the service do NOT require an authenticated user. Currently only the login service has this set. (default: required)
- AuthorizationCheckRemoteServiceServlet.processCall decodes client request
- Logging MDC, method name and session set
- extract AuthenticationContext from session
- if AuthenticationContext is not present and context is required throw AccessDeniedException to client
- if getAuthorizationEngine returns non-null ServiceAuthorication, call checkAuthorization with context, method, and method parameters. ServiceAuthorication will throw an AccessDeniedException or IllegalArgumentException if a client is not authorized or passes bad data.
- call method with parameters. Any results and expected exceptions are encoded and returned to client. Declared exceptions should be logged by client prior to throwing.
- Any unexpected/runtime exception is logged and thrown back to the client.