@Component public abstract class BaseAuthFilter extends BaseIDAFilter
| Modifier and Type | Field and Description |
|---|---|
protected PublicKey |
publicKey
The public key.
|
env, keyManager, mapper| Constructor and Description |
|---|
BaseAuthFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
authenticateRequest(ResettableStreamHttpServletRequest requestWrapper)
authenticateRequest method used to validate the JSON signature pay load and
the certificate
|
protected void |
consumeRequest(ResettableStreamHttpServletRequest requestWrapper,
Map<String,Object> requestBody)
consumeRequest method is used to manipulate the request where the request is
first reached and along this all validation are done further after successful
decipher.
|
protected void |
decipherAndValidateRequest(ResettableStreamHttpServletRequest requestWrapper,
Map<String,Object> requestBody)
Decipher and validate request - Method used to decipher the input stream request
and validate it using
validateDecipheredRequest method. |
protected Map<String,Object> |
decipherRequest(Map<String,Object> requestBody)
decipherRequest method is used to get the deciphered request
from the encoded and enciphered request passed by the
authenticating partner.
|
protected static Object |
decode(String stringToDecode)
Decode method is used to decode the encoded string.
|
protected Map<String,Object> |
encipherResponse(Map<String,Object> responseBody)
encipherResponse method is used to encoded and encrypt
the response received while returning the KYC response.
|
protected String |
getPayloadFromJwsSingature(String jws) |
void |
init(javax.servlet.FilterConfig filterConfig) |
protected Map<String,Object> |
transformResponse(Map<String,Object> responseMap)
transformResponse used to manipulate the response if any.
|
protected abstract void |
validateDecipheredRequest(ResettableStreamHttpServletRequest requestWrapper,
Map<String,Object> decipherRequest)
validateDecipheredRequest - Method used to validate the input stream request
by validating the policy, partner and MISP id of the authenticating partner
once the request is decoded and deciphered.
|
protected void |
validateRequestHMAC(String requestHMAC,
String generatedHMAC)
validateRequestHMAC method is used to validate the HMAC
of the request with the deciphered request block and
requestHMAC received in the request body.
|
protected boolean |
validateRequestSignature(String signature,
byte[] requestAsByte)
validateSignature method is used to authenticate the request
received from the authenticating partner from the pay load received
which consists of the JSON signature and certificate .
|
protected void |
verifyJwsData(String jwsSignature) |
protected boolean |
verifySignature(String jwsSignature) |
destroy, doFilter, fetchId, getRequestBody, isDate, mapResponse, removeNullOrEmptyFieldsInResponse, setResponseParams, validateId, validateRequestprotected PublicKey publicKey
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
init in interface javax.servlet.Filterinit in class BaseIDAFilterjavax.servlet.ServletExceptionprotected void consumeRequest(ResettableStreamHttpServletRequest requestWrapper, Map<String,Object> requestBody) throws IdAuthenticationAppException
BaseIDAFilterconsumeRequest in class BaseIDAFilterrequestWrapper - ResettableStreamHttpServletRequestrequestBody - the request bodyIdAuthenticationAppException - the id authentication app exceptionprotected void decipherAndValidateRequest(ResettableStreamHttpServletRequest requestWrapper, Map<String,Object> requestBody) throws IdAuthenticationAppException
validateDecipheredRequest method.requestWrapper - the request wrapperrequestBody - the request bodyIdAuthenticationAppException - the id authentication app exceptionprotected void verifyJwsData(String jwsSignature) throws IdAuthenticationAppException
IdAuthenticationAppExceptionprotected boolean verifySignature(String jwsSignature)
protected abstract void validateDecipheredRequest(ResettableStreamHttpServletRequest requestWrapper, Map<String,Object> decipherRequest) throws IdAuthenticationAppException
requestWrapper - ResettableStreamHttpServletRequestdecipherRequest - the request got after decode and decipher the input streamIdAuthenticationAppException - the id authentication app exceptionprotected void authenticateRequest(ResettableStreamHttpServletRequest requestWrapper) throws IdAuthenticationAppException
BaseIDAFilterauthenticateRequest in class BaseIDAFilterrequestWrapper - ResettableStreamHttpServletRequestIdAuthenticationAppException - the id authentication app exceptionprotected boolean validateRequestSignature(String signature, byte[] requestAsByte) throws IdAuthenticationAppException
signature - the JWS serialization received through the requestrequestAsByte - the byte array of the request got after decipherIdAuthenticationAppException - the id authentication app exceptionprotected static Object decode(String stringToDecode) throws IdAuthenticationAppException
stringToDecode - the encoded stringIdAuthenticationAppException - the id authentication app exceptionprotected Map<String,Object> decipherRequest(Map<String,Object> requestBody) throws IdAuthenticationAppException
requestBody - the encoded and enciphered request bodyIdAuthenticationAppException - the id authentication app exceptionprotected Map<String,Object> encipherResponse(Map<String,Object> responseBody) throws IdAuthenticationAppException
responseBody - the response received after authenticationIdAuthenticationAppException - the id authentication app exceptionprotected Map<String,Object> transformResponse(Map<String,Object> responseMap) throws IdAuthenticationAppException
BaseIDAFiltertransformResponse in class BaseIDAFilterresponseMap - the response mapIdAuthenticationAppException - the id authentication app exceptionprotected void validateRequestHMAC(String requestHMAC, String generatedHMAC) throws IdAuthenticationAppException
requestHMAC - the requestHMAC received in the request bodygeneratedHMAC - the generated HMAC computed once the request is decoded and decipheredIdAuthenticationAppException - the id authentication app exceptionCopyright © 2020. All rights reserved.