SaurabhChawla100 opened a new pull request, #37231: URL: https://github.com/apache/spark/pull/37231
### What changes were proposed in this pull request? As per the CustomAuthentication(hive.server2.transport.mode=HTTP) in Thrift Server only String username and String password is supported in the authenticate method of PasswdAuthenticationProvider(https://github.com/apache/spark/blob/master/sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/PasswdAuthenticationProvider.java#L37). There is no support for the getting Header param of Request, input param of request, request URI, getMethod if these param is required by the Custom Authentication Service(third party sdk, In House Authentication Service). In order to support CustomAuthentication for Custom Authentication Service(third party Authentication sdk, In House Authentication Service) there is need to add the code change in Spark Code , then only user can add the Custom Authentication. ### Why are the changes needed? There is need to support void AuthenticateRequest(HttpServletRequest request) in the Spark Code base, to integrate the custom Authentication in apache spark For eg ``` public class SampleAuthenticator implements PasswdAuthenticationProvider { static Logger logger = Logger.getLogger(SampleAuthenticator.class.getName()); public SampleAuthenticator() { logger.log(Level.INFO, "initialize SampleAuthenticator"); } @Override public void Authenticate(String user, String password) throws AuthenticationException { } @Override public void AuthenticateRequest(HttpServletRequest request) throws AuthenticationException { Map<String, List<String>> requestHeaders = new HashMap(); // derrive the request headerValue from the HttpServletRequest request logger.log(Level.INFO, "SampleAuthenticator AuthenticateRequest"); dummyAuthenticate(request.getMethod, requestHeaders, request.); } public void dummyAuthenticate(String httpMethod, Map<String, List<String>> requestHeaders, Uri uri) { // Code added for custom Authentication } } ``` ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Manually tested the patch by using above code . -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
