/** * Decode a given Json Web Token. * <p> * Note that this method <b>doesn't verify the token's signature!</b> Use it only if you trust the token or you already verified it. * * @param token with jwt format as string. * @return a decoded JWT. * @throws JWTDecodeException if any part of the token contained an invalid jwt or JSON format of each of the jwt parts. */ public DecodedJWT decodeJwt(String token) throws JWTDecodeException { return new JWTDecoder(parser, token); }
/** * Decode a given Json Web Token. * <p> * Note that this method <b>doesn't verify the token's signature!</b> Use it only if you trust the token or you already verified it. * * @param token with jwt format as string. * @return a decoded JWT. * @throws JWTDecodeException if any part of the token contained an invalid jwt or JSON format of each of the jwt parts. */ public static DecodedJWT decode(String token) throws JWTDecodeException { return new JWTDecoder(token); }
/** * Perform the verification against the given Token, using any previous configured options. * * @param token to verify. * @return a verified and decoded JWT. * @throws AlgorithmMismatchException if the algorithm stated in the token's header it's not equal to the one defined in the {@link JWTVerifier}. * @throws SignatureVerificationException if the signature is invalid. * @throws TokenExpiredException if the token has expired. * @throws InvalidClaimException if a claim contained a different value than the expected one. */ @Override public DecodedJWT verify(String token) throws JWTVerificationException { DecodedJWT jwt = new JWTDecoder(parser, token); return verify(jwt); }
/** * Decode a given Json Web Token. * <p> * Note that this method <b>doesn't verify the token's signature!</b> Use it only if you trust the token or you already verified it. * * @param token with jwt format as string. * @return a decoded JWT. * @throws JWTDecodeException if any part of the token contained an invalid jwt or JSON format of each of the jwt parts. */ public DecodedJWT decodeJwt(String token) throws JWTDecodeException { return new JWTDecoder(parser, token); }
/** * Decode a given Json Web Token. * <p> * Note that this method <b>doesn't verify the token's signature!</b> Use it only if you trust the token or you already verified it. * * @param token with jwt format as string. * @return a decoded JWT. * @throws JWTDecodeException if any part of the token contained an invalid jwt or JSON format of each of the jwt parts. */ public static DecodedJWT decode(String token) throws JWTDecodeException { return new JWTDecoder(token); }
/** * Perform the verification against the given Token, using any previous configured options. * * @param token to verify. * @return a verified and decoded JWT. * @throws AlgorithmMismatchException if the algorithm stated in the token's header it's not equal to the one defined in the {@link JWTVerifier}. * @throws SignatureVerificationException if the signature is invalid. * @throws TokenExpiredException if the token has expired. * @throws InvalidClaimException if a claim contained a different value than the expected one. */ @Override public DecodedJWT verify(String token) throws JWTVerificationException { DecodedJWT jwt = new JWTDecoder(parser, token); return verify(jwt); }