apache/kyuubi

[FEATURE] Support to return authentication subject with PasswdAuthenticationProvider

开放

#4,630 创建于 2023年3月29日

 (2 条评论) (0 个反应) (0 位负责人)Scala (996 个派生)batch import
help wantedkind:featurepriority:major

仓库指标

星标
 (2,332 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Code of Conduct

Search before asking

  • I have searched in the issues and found no similar issues.

Describe the feature

Now the PasswdAuthenticationProvider only authenticate whether the specified user name and password is valid, and nothing return.

trait PasswdAuthenticationProvider {
  @throws[AuthenticationException]
  def authenticate(user: String, password: String): Unit
}

In fact, in some use case, the transferred user name is not the valid user name. It might be a key pair, and is a limited secret used for some use cases.

It is better that we can add a new method to return a subject to provided more authentication info.

Such as :

trait PasswdAuthenticationProvider {
  @throws[AuthenticationException]
  def authenticate(user: String, password: String): Unit

  def authenticateAndReturnSubject(user: String, password: String): Subject = {
    authenticate(user, password)
    new Subject(user)
  }
}

Motivation

cover more password authentication use case.

Describe the solution

No response

Additional context

No response

Are you willing to submit PR?

  • Yes. I would be willing to submit a PR with guidance from the Kyuubi community to improve.
  • No. I cannot submit a PR at this time.

贡献者指南