You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/09/01 09:24:00 UTC

[jira] [Work logged] (KNOX-2651) NPE when token value is missing

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

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

                Author: ASF GitHub Bot
            Created on: 01/Sep/21 09:23
            Start Date: 01/Sep/21 09:23
    Worklog Time Spent: 10m 
      Work Description: zeroflag commented on a change in pull request #487:
URL: https://github.com/apache/knox/pull/487#discussion_r699105799



##########
File path: gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/JWTFederationFilter.java
##########
@@ -126,7 +126,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
     }
     final Pair<TokenType, String> wireToken = getWireToken(request);
 
-    if (wireToken != null) {
+    if (wireToken != null && wireToken.getLeft() != null && wireToken.getRight() != null) {

Review comment:
       Good point.




-- 
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: dev-unsubscribe@knox.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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

    Worklog Id:     (was: 644983)
    Time Spent: 1h 10m  (was: 1h)

> NPE when token value is missing
> -------------------------------
>
>                 Key: KNOX-2651
>                 URL: https://issues.apache.org/jira/browse/KNOX-2651
>             Project: Apache Knox
>          Issue Type: Task
>            Reporter: Attila Magyar
>            Assignee: Attila Magyar
>            Priority: Major
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> This happens when one accidentally puts a space between the user and password.
> {code:java}
> $ curl -vvv -iku Token: xxxxxxx https://localhost:8443/gateway/sandbox/webhdfs/v1/?op=LISTSTATUS {code}
>  
> {code:java}
> Caused by: java.lang.NullPointerException
>     at com.nimbusds.jose.JOSEObject.split(JOSEObject.java:214)
>     at com.nimbusds.jwt.SignedJWT.parse(SignedJWT.java:110)
>     at org.apache.knox.gateway.services.security.token.impl.JWTToken.<init>(JWTToken.java:55)
>     at org.apache.knox.gateway.provider.federation.jwt.filter.JWTFederationFilter.doFilter(JWTFederationFilter.java:135)
>     at org.apache.knox.gateway.GatewayFilter$Holder.doFilter(GatewayFilter.java:348)
>     at org.apache.knox.gateway.GatewayFilter$Chain.doFilter(GatewayFilter.java:262)
>     at org.apache.knox.gateway.filter.XForwardedHeaderFilter.doFilter(XForwardedHeaderFilter.java:50)
>     at org.apache.knox.gateway.filter.AbstractGatewayFilter.doFilter(AbstractGatewayFilter.java:58)
>     ... 54 more {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)