-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/74000/
-----------------------------------------------------------

Review request for ranger, Bhavik Bavishi, Abhay Kulkarni, Madhan Neethiraj, 
and Pradeep Agrawal.


Bugs: RANGER-3778
    https://issues.apache.org/jira/browse/RANGER-3778


Repository: ranger


Description
-------

I found NullPointerException happens again with kerberos login, this time is 
due to sessionMgr.
The reason is that: sometimes RangerAuthenticationProvider is not managed by 
spring but created by new in RangerKRBAuthenticationFilter
RangerAuthenticationProvider authenticationProvider = new 
RangerAuthenticationProvider();
Authentication authentication = 
authenticationProvider.authenticate(finalAuthentication);
 
Only beans managed by spring is ensured to auto-wire its members. So at that 
situation, userMgr and sessionMgr are both null.
But I do not know why we call authenticationProvider.authenticate here. It is 
already authenticated by Kerberos. 

I have traced the code, After a series of condition judgments, the 
authentication object passed in was returned finally without any modification. 
And nothing happens such like register new session, access database... Because 
at that point, user is already authenticated by Kerberos.

So I removed some useless code here.


Diffs
-----

  
security-admin/src/main/java/org/apache/ranger/security/web/filter/RangerKRBAuthenticationFilter.java
 2d3308b999c6ab575325777d14e3ab0a6661f2a0 


Diff: https://reviews.apache.org/r/74000/diff/1/


Testing
-------


Thanks,

Kirby Zhou

Reply via email to