Skip to content

Commit

Permalink
Reloacate the comment for cxf lib
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <[email protected]>
  • Loading branch information
RyanL1997 committed Oct 24, 2023
1 parent 85d7eaa commit 2c2560b
Showing 1 changed file with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,19 @@ public void testInvalid() throws Exception {
Assert.assertNull(credentials);
}

/** Here is the original encoded jwt token generation with cxf library:
*
* String base64EncodedSecret = Base64.getEncoder().encodeToString(someSecret.getBytes(StandardCharsets.UTF_8));
* JwtClaims claims = new JwtClaims();
* claims.setIssuedAt(100L);
* claims.setIssuer("cluster_0");
* JwsSignatureProvider jwsSignatureProvider = new HmacJwsSignatureProvider(base64EncodedSecret, SignatureAlgorithm.HS512);
* JweEncryptionProvider jweEncryptionProvider = null;
* JoseJwtProducer producer = new JoseJwtProducer();
* String encodedCxfJwt = producer.processJwt(jwtToken, jweEncryptionProvider, jwsSignatureProvider);
*/
@Test
public void testParsePrevGeneratedJwt() {

/* Here is the original encoded jwt token generation with cxf library:
*
* String base64EncodedSecret = Base64.getEncoder().encodeToString(someSecret.getBytes(StandardCharsets.UTF_8));
* JwtClaims claims = new JwtClaims();
* claims.setIssuedAt(100L);
* claims.setIssuer("cluster_0");
* JwsSignatureProvider jwsSignatureProvider = new HmacJwsSignatureProvider(base64EncodedSecret, SignatureAlgorithm.HS512);
* JweEncryptionProvider jweEncryptionProvider = null;
* JoseJwtProducer producer = new JoseJwtProducer();
* String encodedCxfJwt = producer.processJwt(jwtToken, jweEncryptionProvider, jwsSignatureProvider);
*/

String encodedCxfJwt =
"eyJhbGciOiJIUzUxMiJ9.eyJuYmYiOjE2OTgxNTE4ODQsImV4cCI6MTY5ODE1NTQ4NCwic3ViIjoiaG9yc3QiLCJzYW1sX25pZiI6InUiLCJzYW1sX3NpIjoiTU9DS1NBTUxfMyIsInJvbGVzIjpudWxsfQ.E_MP8wVVu1P7_RATtjhnCvPft2gQTFdY5NlmRTCsrjdDXTUfxkswktWCB_k_wXDKCuNukNlSL2FSo3EV2VtUEQ";
Settings settings = Settings.builder()
Expand Down

0 comments on commit 2c2560b

Please sign in to comment.