You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Colm O hEigeartaigh (Jira)" <ji...@apache.org> on 2026/09/30 18:48:00 UTC
[jira] [Resolved] (CXF-8651) JOSE: JwsJwtCompactProducer not parsing headers properly if the claims contains \n
[ https://issues.apache.org/jira/browse/CXF-8651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Colm O hEigeartaigh resolved CXF-8651.
--------------------------------------
Resolution: Fixed
This was fixed since the Jira was reported, resolving it.
> JOSE: JwsJwtCompactProducer not parsing headers properly if the claims contains \n
> ----------------------------------------------------------------------------------
>
> Key: CXF-8651
> URL: https://issues.apache.org/jira/browse/CXF-8651
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS Security
> Affects Versions: 3.5.0, 3.4.4
> Reporter: Roberto Viani Junior
> Priority: Major
>
> The JWS is generate with an invalid payload if I try to set a claim like this:
> JwtClaims claims = new JwtClaims();
> String claim = "GET\n\n\nWed, 19 Jan 2022 15:25:29 GMT\n/test/16c8a1ec-8d75-47a1-b138-46746713b8d8";
> claims.setClaim("test", claim);
> JwsCompactProducer jwsProducer = new JwsJwtCompactProducer(claims);
>
> The JWS payload result will be: eyJ0ZXN0IjoiR0VUCgoKV2VkLCAxOSBKYW4gMjAyMiAxNToyNToyOSBHTVQKL3Rlc3QvMTZjOGExZWMtOGQ3NS00N2ExLWIxMzgtNDY3NDY3MTNiOGQ4In0
> And when I decode the result is:
> "\{\"test\":\"GET\n\n\nWed, 19 Jan 2022 15:25:29 GMT\n/test/16c8a1ec-8d75-47a1-b138-46746713b8d8\"}"
> This is an invalid payload because the json is stringify.. the json should be:
> {
> "test" : "GET\n\n\nWed, 19 Jan 2022 15:25:29 GMT\n/test/16c8a1ec-8d75-47a1-b138-46746713b8d8"
> }
--
This message was sent by Atlassian Jira
(v8.20.10#820010)