Class SIPBasicAuthTokenExtractor
java.lang.Object
de.ikor.sip.foundation.security.authentication.basic.SIPBasicAuthTokenExtractor
- All Implemented Interfaces:
SIPTokenExtractor<SIPBasicAuthAuthenticationToken>
public class SIPBasicAuthTokenExtractor
extends Object
implements SIPTokenExtractor<SIPBasicAuthAuthenticationToken>
Token extractor for getting username and password from the Basic Authentication header.
- Author:
- thomas.stieglmaier
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionextract
(javax.servlet.http.HttpServletRequest request) Extracts a token of the given type from a request.The type of the token to be extracted
-
Constructor Details
-
SIPBasicAuthTokenExtractor
public SIPBasicAuthTokenExtractor()
-
-
Method Details
-
extract
Description copied from interface:SIPTokenExtractor
Extracts a token of the given type from a request. Implementations of this method should throwBadCredentialsException
in case necessary token was not found, or had an invalid format, for proper mapping of the response status code (401 Unauthorized). Other exceptions will be mapped to internal server error.- Specified by:
extract
in interfaceSIPTokenExtractor<SIPBasicAuthAuthenticationToken>
- Parameters:
request
- the request the token should be extracted from- Returns:
- the extracted token
-
getTokenType
Description copied from interface:SIPTokenExtractor
The type of the token to be extracted- Specified by:
getTokenType
in interfaceSIPTokenExtractor<SIPBasicAuthAuthenticationToken>
- Returns:
- the token type
-