Class Servlet3JwtAuthenticationEngine

java.lang.Object
io.telicent.servlet.auth.jwt.JwtAuthenticationEngine<TRequest,TResponse>
io.telicent.servlet.auth.jwt.HeaderBasedJwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
io.telicent.servlet.auth.jwt.servlet3.Servlet3JwtAuthenticationEngine

public class Servlet3JwtAuthenticationEngine extends HeaderBasedJwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
A JSON Web Token (JWT) authentication engine for use with javax.servlet based applications
  • Constructor Details

    • Servlet3JwtAuthenticationEngine

      public Servlet3JwtAuthenticationEngine()
      Creates a new authentication engine with default configuration
    • Servlet3JwtAuthenticationEngine

      public Servlet3JwtAuthenticationEngine(Collection<HeaderSource> headers, String realm, Collection<String> usernameClaims)
      Creates a new authentication engine using the provided configuration
      Parameters:
      headers - Header sources
      realm - Realm
      usernameClaims - Username claims
  • Method Details

    • hasRequiredParameters

      protected boolean hasRequiredParameters(javax.servlet.http.HttpServletRequest request)
      Specified by:
      hasRequiredParameters in class JwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
    • extractTokens

      protected List<TokenCandidate> extractTokens(javax.servlet.http.HttpServletRequest request)
      Specified by:
      extractTokens in class JwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
    • prepareRequest

      protected javax.servlet.http.HttpServletRequest prepareRequest(javax.servlet.http.HttpServletRequest request, io.jsonwebtoken.Jws<io.jsonwebtoken.Claims> jws, String username)
      Specified by:
      prepareRequest in class JwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
    • sendChallenge

      protected void sendChallenge(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Challenge challenge)
      Specified by:
      sendChallenge in class JwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
    • sendError

      protected void sendError(javax.servlet.http.HttpServletResponse response, Throwable err)
      Specified by:
      sendError in class JwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
    • getRequestUrl

      protected String getRequestUrl(javax.servlet.http.HttpServletRequest request)
      Specified by:
      getRequestUrl in class JwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
    • setRequestAttribute

      protected void setRequestAttribute(javax.servlet.http.HttpServletRequest request, String attribute, Object value)
      Specified by:
      setRequestAttribute in class JwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>