[ 
https://issues.apache.org/jira/browse/SPARK-39820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Saurabh Chawla updated SPARK-39820:
-----------------------------------
    Description: 
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<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
  }    
}
{code}
So there is need to support void AuthenticateRequest(HttpServletRequest 
request) in the Spark Code base, to integrate the custom Authentication in 
apache spark

  was:
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. 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<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
  }    
}
{code}
So there is need to support void AuthenticateRequest(HttpServletRequest 
request) in the Spark Code base, to integrate the custom Authentication in 
apache spark


> 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<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
>   }    
> }
> {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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to