@Test @Deprecated public void deprecatedConstructor() { DecodedJwt decodedJwt = new Base64JwtDecoder().decode("header..signature"); assertEquals("", decodedJwt.getPayload()); }
public DecodedJwt decode(String jwt) { Assertions.assertNotNull(jwt, "JWT must not be null"); String[] parts = jwt.split(Pattern.quote(".")); if (parts.length != 3) { throw new IllegalArgumentException("JWT token does not consist of 'header'.'payload'.'signature'."); } String header = base64Decode(parts[0]); String payload = base64Decode(parts[1]); String signature = parts[2]; return new DecodedJwtImpl(jwt, header, payload, signature); }
Base64JwtDecoder { public DecodedJwt decode(String jwt) { Assertions.assertNotNull(jwt, "JWT must not be null"); String[] parts = jwt.split(Pattern.quote(".")); if (parts.length != 3) { throw new IllegalArgumentException("JWT token does not consist of 'header'.'payload'.'signature'."); } String header = base64Decode(parts[0]); String payload = base64Decode(parts[1]); String signature = parts[2]; return new DecodedJwtImpl(jwt, header, payload, signature); } }
Base64JwtDecoder { public DecodedJwt decode(String jwt) { Assertions.assertNotNull(jwt, "JWT must not be null"); String[] parts = jwt.split(Pattern.quote(".")); if (parts.length != 3) { throw new IllegalArgumentException("JWT token does not consist of 'header'.'payload'.'signature'."); } String header = base64Decode(parts[0]); String payload = base64Decode(parts[1]); String signature = parts[2]; return new DecodedJwtImpl(jwt, header, payload, signature); } @Deprecated  Base64JwtDecoder(); }
Base64JwtDecoder { public DecodedJwt decode(String jwt) { Assertions.assertNotNull(jwt, "JWT must not be null"); String[] parts = jwt.split(Pattern.quote(".")); if (parts.length != 3) { throw new IllegalArgumentException("JWT token does not consist of 'header'.'payload'.'signature'."); } String header = base64Decode(parts[0]); String payload = base64Decode(parts[1]); String signature = parts[2]; return new DecodedJwtImpl(jwt, header, payload, signature); } @Deprecated  Base64JwtDecoder(); static Base64JwtDecoder getInstance(); DecodedJwt decode(String jwt); }
Base64JwtDecoder { public DecodedJwt decode(String jwt) { Assertions.assertNotNull(jwt, "JWT must not be null"); String[] parts = jwt.split(Pattern.quote(".")); if (parts.length != 3) { throw new IllegalArgumentException("JWT token does not consist of 'header'.'payload'.'signature'."); } String header = base64Decode(parts[0]); String payload = base64Decode(parts[1]); String signature = parts[2]; return new DecodedJwtImpl(jwt, header, payload, signature); } @Deprecated  Base64JwtDecoder(); static Base64JwtDecoder getInstance(); DecodedJwt decode(String jwt);  }