[jira] [Commented] (SPARK-39820) Add the Support for Custom Authentication for Thrift Server using Http Servlet Request input Param
[ https://issues.apache.org/jira/browse/SPARK-39820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17568848#comment-17568848 ] Apache Spark commented on SPARK-39820: -- User 'SaurabhChawla100' has created a pull request for this issue: https://github.com/apache/spark/pull/37231 > Add the Support for Custom Authentication for Thrift Server using Http > Servlet Request input Param > -- > > Key: SPARK-39820 > URL: https://issues.apache.org/jira/browse/SPARK-39820 > Project: Spark > Issue Type: Improvement > Components: SQL >Affects Versions: 3.3.0 >Reporter: Saurabh Chawla >Priority: Minor > > 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 sdk, In House Authentication Service) there is need to > add the code change in Spark Code , than only user can add the Custom > Authentication. > For Example > {code:java} > 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> 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> > requestHeaders, Uri uri) { > // Code added for custom Authentication > } > } > {code} > So there is need to support void AuthenticateRequest(HttpServletRequest > request) in the Spark Code base, to integrate the custom Authentication in > apache spark -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org
[jira] [Commented] (SPARK-39820) Add the Support for Custom Authentication for Thrift Server using Http Servlet Request input Param
[ https://issues.apache.org/jira/browse/SPARK-39820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17568849#comment-17568849 ] Apache Spark commented on SPARK-39820: -- User 'SaurabhChawla100' has created a pull request for this issue: https://github.com/apache/spark/pull/37231 > Add the Support for Custom Authentication for Thrift Server using Http > Servlet Request input Param > -- > > Key: SPARK-39820 > URL: https://issues.apache.org/jira/browse/SPARK-39820 > Project: Spark > Issue Type: Improvement > Components: SQL >Affects Versions: 3.3.0 >Reporter: Saurabh Chawla >Priority: Minor > > 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 sdk, In House Authentication Service) there is need to > add the code change in Spark Code , than only user can add the Custom > Authentication. > For Example > {code:java} > 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> 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> > requestHeaders, Uri uri) { > // Code added for custom Authentication > } > } > {code} > So there is need to support void AuthenticateRequest(HttpServletRequest > request) in the Spark Code base, to integrate the custom Authentication in > apache spark -- This message was sent by Atlassian Jira (v8.20.10#820010) - To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org