Class JWTPreviewTokenDecoder
java.lang.Object
com.broadleafcommerce.data.tracking.core.preview.JWTPreviewTokenDecoder
- All Implemented Interfaces:
- PreviewTokenDecoder
A default implementation of the 
PreviewTokenDecoder that decoded the PreviewToken
 from a JWT token string.- Author:
- Nick Crum (ncrum)
- 
Constructor SummaryConstructorsConstructorDescriptionJWTPreviewTokenDecoder(com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper mapper) Optional constructor if looking to manually configure the decoder using the setters.JWTPreviewTokenDecoder(JWTPreviewTokenDecoderProperties properties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper mapper) Primary constructor for initializing the decoder
- 
Method SummaryModifier and TypeMethodDescriptionprotected PreviewTokenconvertToPreviewToken(com.nimbusds.jwt.JWTClaimsSet claims) Decoded an encoded preview token string into aPreviewToken.protected com.fasterxml.jackson.databind.ObjectMapperprotected JWTPreviewTokenDecoderPropertiesprotected com.broadleafcommerce.common.extension.TypeFactoryprotected com.nimbusds.jose.JWSVerifiervoidsetEncodedPublicKey(String encodedPublicKey) Sets the value ofJWTPreviewTokenDecoderProperties.getEncodedPublicKey(), and initializes theverifierused to verify JWT tokens.voidSetter for overwriting the current issuer onJWTPreviewTokenDecoderProperties.protected voidvalidateJWT(com.nimbusds.jwt.SignedJWT signedJWT) 
- 
Constructor Details- 
JWTPreviewTokenDecoderpublic JWTPreviewTokenDecoder(JWTPreviewTokenDecoderProperties properties, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper mapper) Primary constructor for initializing the decoder- Parameters:
- properties- the property configuration for the decoder
 
- 
JWTPreviewTokenDecoderpublic JWTPreviewTokenDecoder(com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.fasterxml.jackson.databind.ObjectMapper mapper) Optional constructor if looking to manually configure the decoder using the setters.
 
- 
- 
Method Details- 
setEncodedPublicKeySets the value ofJWTPreviewTokenDecoderProperties.getEncodedPublicKey(), and initializes theverifierused to verify JWT tokens.- Parameters:
- encodedPublicKey- the encoded public key
 
- 
setIssuerSetter for overwriting the current issuer onJWTPreviewTokenDecoderProperties.- Parameters:
- issuer- the issuer
 
- 
decodeDescription copied from interface:PreviewTokenDecoderDecoded an encoded preview token string into aPreviewToken.- Specified by:
- decodein interface- PreviewTokenDecoder
- Parameters:
- encodedTokenString- the encoded preview token string
- Returns:
- the decoded preview token
- Throws:
- PreviewTokenParseException- when there is an issue with the parsing of the encoded token
 
- 
validateJWTprotected void validateJWT(com.nimbusds.jwt.SignedJWT signedJWT) throws ParseException, PreviewTokenParseException 
- 
convertToPreviewTokenprotected PreviewToken convertToPreviewToken(com.nimbusds.jwt.JWTClaimsSet claims) throws PreviewTokenParseException - Throws:
- PreviewTokenParseException
 
- 
getProperties
- 
getTypeFactoryprotected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
- 
getMapperprotected com.fasterxml.jackson.databind.ObjectMapper getMapper()
- 
getVerifierprotected com.nimbusds.jose.JWSVerifier getVerifier()
 
-