[ 
https://issues.apache.org/jira/browse/KNOX-2703?focusedWorklogId=710689&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-710689
 ]

ASF GitHub Bot logged work on KNOX-2703:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 18/Jan/22 17:52
            Start Date: 18/Jan/22 17:52
    Worklog Time Spent: 10m 
      Work Description: smolnar82 commented on a change in pull request #532:
URL: https://github.com/apache/knox/pull/532#discussion_r787012226



##########
File path: 
gateway-spi/src/main/java/org/apache/knox/gateway/services/security/token/impl/JWTToken.java
##########
@@ -122,6 +129,10 @@ public JWTToken(String alg, String[] claimsArray, 
List<String> audiences, boolea
     jwt = new SignedJWT(header, claims);
   }
 
+  private String getClaimValue(String[] claims, int index) {
+    return claims == null || claims.length < index ? null : claims[index];

Review comment:
       Nice catch! Fixed :)

##########
File path: 
gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/JWTFederationFilter.java
##########
@@ -90,6 +94,14 @@ public void init( FilterConfig filterConfig ) throws 
ServletException {
       expectedJWKSUrl = oidcjwksurl;
     }
 
+    allowedJwsTypes = new HashSet<>();
+    final String allowedTypes = 
filterConfig.getInitParameter(ALLOWED_JWS_TYPES);
+    if (allowedTypes != null) {
+      Stream.of(allowedTypes.trim().split(",", -1)).forEach(allowedType -> 
allowedJwsTypes.add(new JOSEObjectType(allowedType.trim())));

Review comment:
       Nice catch! Fixed :)




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 710689)
    Time Spent: 40m  (was: 0.5h)

> Make acceptable JWT types configurable
> --------------------------------------
>
>                 Key: KNOX-2703
>                 URL: https://issues.apache.org/jira/browse/KNOX-2703
>             Project: Apache Knox
>          Issue Type: New Feature
>          Components: Server
>    Affects Versions: 1.6.0, 1.6.1, 1.6.2
>            Reporter: Sandor Molnar
>            Assignee: Sandor Molnar
>            Priority: Critical
>             Fix For: 2.0.0
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> With KNOX-2149, one can define their own JWKS URL which Knox can use for 
> verification.
> However, the current implementation only supports JWTs with {{"typ: JWT"}} in 
> their headers (or not type definition at all). In previous JOSE versions, 
> there were other supported types such as {{{}at+jwt{}}}.
> It'd be beneficial to have the list of allowed JWT types defined on the 
> topology level. If not defined, Knox should use the current default 
> ({{{}JWT{}}}).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to