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-
Field Summary
Fields inherited from class io.telicent.servlet.auth.jwt.HeaderBasedJwtAuthenticationEngine
headers, realm, UNEXPECTED_ERROR_MESSAGE, usernameClaimsFields inherited from class io.telicent.servlet.auth.jwt.JwtAuthenticationEngine
NO_AUTH_TOKEN_FOUND -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new authentication engine with default configurationServlet3JwtAuthenticationEngine(Collection<HeaderSource> headers, String realm, Collection<String> usernameClaims) Creates a new authentication engine using the provided configuration -
Method Summary
Modifier and TypeMethodDescriptionprotected List<TokenCandidate>extractTokens(javax.servlet.http.HttpServletRequest request) protected StringgetRequestUrl(javax.servlet.http.HttpServletRequest request) protected booleanhasRequiredParameters(javax.servlet.http.HttpServletRequest request) protected javax.servlet.http.HttpServletRequestprepareRequest(javax.servlet.http.HttpServletRequest request, io.jsonwebtoken.Jws<io.jsonwebtoken.Claims> jws, String username) protected voidsendChallenge(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Challenge challenge) protected voidprotected voidsetRequestAttribute(javax.servlet.http.HttpServletRequest request, String attribute, Object value) Methods inherited from class io.telicent.servlet.auth.jwt.HeaderBasedJwtAuthenticationEngine
extractUsername, selectRealm, toStringMethods inherited from class io.telicent.servlet.auth.jwt.JwtAuthenticationEngine
authenticate, buildAuthorizationHeader, buildChallengeParameters
-
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 sourcesrealm- RealmusernameClaims- Username claims
-
-
Method Details
-
hasRequiredParameters
protected boolean hasRequiredParameters(javax.servlet.http.HttpServletRequest request) - Specified by:
hasRequiredParametersin classJwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
-
extractTokens
- Specified by:
extractTokensin classJwtAuthenticationEngine<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:
prepareRequestin classJwtAuthenticationEngine<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:
sendChallengein classJwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
-
sendError
- Specified by:
sendErrorin classJwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
-
getRequestUrl
- Specified by:
getRequestUrlin classJwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
-
setRequestAttribute
protected void setRequestAttribute(javax.servlet.http.HttpServletRequest request, String attribute, Object value) - Specified by:
setRequestAttributein classJwtAuthenticationEngine<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
-