[ 
https://issues.apache.org/jira/browse/CXF-7760?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16521489#comment-16521489
 ] 

Juan edited comment on CXF-7760 at 6/24/18 1:31 PM:
----------------------------------------------------

Hi [~coheigea], 

Please refer to the following reproduction:
{code:java}
JsonMapObjectReaderWriter jsonMapObjectReaderWriter = new 
JsonMapObjectReaderWriter();
String part1 = 
"eyJraWQiOiI0cFpiZTRzaFFRR3paWEhiZUlsYkR2bUhPYzFcL0g2akg2b0JrM25VcmNaRT0iLCJhbGciOiJSUzI1NiJ9";
String innerJson = new String(java.util.Base64.getUrlDecoder()
.decode(part1), StandardCharsets.UTF_8);
Map<String, Object> innerJsonParsed = 
jsonMapObjectReaderWriter.fromJson(innerJson);
System.out.printf("kid Expected: %s%n", new ObjectMapper().readValue(innerJson, 
Map.class)
.get("kid"));
System.out.printf("kid Actual: %s%n", innerJsonParsed.get("kid"));
{code}
Output:
{code:java}
kid Expected: 4pZbe4shQQGzZXHbeIlbDvmHOc1/H6jH6oBk3nUrcZE=
kid Actual: 4pZbe4shQQGzZXHbeIlbDvmHOc1\/H6jH6oBk3nUrcZE=
{code}
The '\/' should be evaluated to '/', please refer to[1] as performed by Jackson.

Thanks!

[1] https://www.json.org/


was (Author: roldan):
Hi [~coheigea], 

I've provided feedback to reproduce. I believe the problem is in the CXF JSON 
parsing. Please let me know if I can provide further information.

Thanks!

> JOSE: JwsCompactConsumer parsing headers issue
> ----------------------------------------------
>
>                 Key: CXF-7760
>                 URL: https://issues.apache.org/jira/browse/CXF-7760
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS Security
>    Affects Versions: 3.1.13
>            Reporter: Juan
>            Priority: Major
>
> When using the JwsCompactConsumer with a compact JWT whose kid contains a 
> slash, the json parser escapes it, which causes issues later on while 
> matching the kid to the one specified in the JWKS. For example:
> Header:
> {
>  "kid": "4pZbe4shQQGzZXHbeIlbDvmHOc1/H6jH6oBk3nUrcZE=",
>  "alg": "RS256"
> }
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to