Module io.inverno.mod.security.http
Package io.inverno.mod.security.http
Class HttpAuthenticationErrorInterceptor<A extends ExchangeContext,B extends ErrorExchange<A>>
java.lang.Object
io.inverno.mod.security.http.AuthenticationErrorInterceptor<A,B>
io.inverno.mod.security.http.HttpAuthenticationErrorInterceptor<A,B>
- Type Parameters:
A
- the context typeB
- the error exchange type
- All Implemented Interfaces:
ExchangeInterceptor<A,
B>
- Direct Known Subclasses:
BasicAuthenticationErrorInterceptor
,DigestAuthenticationErrorInterceptor
public abstract class HttpAuthenticationErrorInterceptor<A extends ExchangeContext,B extends ErrorExchange<A>>
extends AuthenticationErrorInterceptor<A,B>
An authentication error interceptor that implements RFC 7235 HTTP authentication.
As per RFC 7235, this interceptor sends a challenge to the requester in the www-authenticate
HTTP header on an UNAUTHORIZED(401)
error.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
Fields inherited from class io.inverno.mod.security.http.AuthenticationErrorInterceptor
terminal
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
createChallenge
(SecurityException cause) Creates the challenge to send to the requester.protected void
interceptUnauthorized
(B exchange) Intercepts an unauthorized exchange.Methods inherited from class io.inverno.mod.security.http.AuthenticationErrorInterceptor
intercept
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.mod.http.server.ExchangeInterceptor
andThen, compose
-
Constructor Details
-
HttpAuthenticationErrorInterceptor
public HttpAuthenticationErrorInterceptor()
-
-
Method Details
-
interceptUnauthorized
Description copied from class:AuthenticationErrorInterceptor
Intercepts an unauthorized exchange.
- Specified by:
interceptUnauthorized
in classAuthenticationErrorInterceptor<A extends ExchangeContext,
B extends ErrorExchange<A>> - Parameters:
exchange
- the unauthorized exchange to intercept- Throws:
HttpException
- if there was an error intercepting the exchange
-
createChallenge
Creates the challenge to send to the requester.
- Parameters:
cause
- the cause of the error (can be null)- Returns:
- a challenge
-