Class SimpleRouteAuthenticator
java.lang.Object
com.kingsrook.qqq.middleware.javalin.routeproviders.authentication.SimpleRouteAuthenticator
- All Implemented Interfaces:
RouteAuthenticatorInterface
simple implementation of a route authenticator. Assumes that unauthenticated
requests should redirect to a login page. Note though, maybe that should be
more intelligent, like, only redirect requests for a .html file, but not
requests for include files like images or .js/.css?
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticateRequest(io.javalin.http.Context context) Authenticate an HTTP request using QQQ's authentication system.
-
Constructor Details
-
SimpleRouteAuthenticator
public SimpleRouteAuthenticator()
-
-
Method Details
-
authenticateRequest
Authenticate an HTTP request using QQQ's authentication system. Sets up the QQQ session from the request context. If authentication fails, redirects unauthenticated requests to the login page provided by the authentication module. Special handling for OAuth callbacks: If the request contains 'code' and 'state' query parameters (OAuth callback), redirects to the same URL with those parameters removed to prevent them from appearing in the browser URL.- Specified by:
authenticateRequestin interfaceRouteAuthenticatorInterface- Parameters:
context- the Javalin HTTP context- Returns:
- true if authenticated and should proceed; false if redirected
- Throws:
QException- if authentication processing fails
-