Skip to content

discussion: enable OAuth2 authentication for risingwave #11440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
yezizp2012 opened this issue Aug 4, 2023 · 2 comments
Open

discussion: enable OAuth2 authentication for risingwave #11440

yezizp2012 opened this issue Aug 4, 2023 · 2 comments
Assignees
Labels
help wanted Issues that need help from contributors no-issue-activity type/feature

Comments

@yezizp2012
Copy link
Member

yezizp2012 commented Aug 4, 2023

Is your feature request related to a problem? Please describe.

Feature required from cloud.

  1. SASL: https://www.postgresql.org/docs/devel/sasl-authentication.html. Its authentication method is as follows:
To begin with, the SCRAM client is in possession of a username and  
   password (*) (or a ClientKey/ServerKey, or SaltedPassword).  It sends  
   the username to the server, which retrieves the corresponding  
   authentication information, i.e., a salt, StoredKey, ServerKey, and  
   the iteration count i.  (Note that a server implementation may choose  
   to use the same iteration count for all accounts.)  The server sends  
   the salt and the iteration count to the client, which then computes  
   the following values and sends a ClientProof to the server:  
  
     SaltedPassword  := Hi(Normalize(password), salt, i)  
     ClientKey       := HMAC(SaltedPassword, "Client Key")  
     StoredKey       := H(ClientKey)  
     AuthMessage     := client-first-message-bare + "," +  
                        server-first-message + "," +  
                        client-final-message-without-proof  
     ClientSignature := HMAC(StoredKey, AuthMessage)  
     ClientProof     := ClientKey XOR ClientSignature  
     ServerKey       := HMAC(SaltedPassword, "Server Key")  
     ServerSignature := HMAC(ServerKey, AuthMessage)  
  
   The server authenticates the client by computing the ClientSignature,  
   exclusive-ORing that with the ClientProof to recover the ClientKey  
   and verifying the correctness of the ClientKey by applying the hash  
   function and comparing the result to the StoredKey.  If the ClientKey  
   is correct, this proves that the client has access to the user's  
   password.  
  
   Similarly, the client authenticates the server by computing the  
   ServerSignature and comparing it to the value sent by the server.  If  
   the two are equal, it proves that the server had access to the user's  
   ServerKey.  
  
   The AuthMessage is computed by concatenating messages from the  
   authentication exchange.  The format of these messages is defined in  
   Section 7. 
  1. PAM:https://www.postgresql.org/docs/current/auth-pam.html
    An workaround way to enable OAuth2 in postgreSQL, we may refer: https://www.janua.fr/postgres-oauth2-authentication/

  2. Native support for OAuth and service interaction that issues authentication tokens.
    Implement a token verification logic by oneself, when the user's password is managed through tokens, interact and verify with the token issuing center. Specific details to be discussed.

Links that might help:
Authentication methods in PostgreSQL
Configuring OAUTHBEARER in kafka

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

@yezizp2012 yezizp2012 added type/feature help wanted Issues that need help from contributors labels Aug 4, 2023
@github-actions github-actions bot added this to the release-1.2 milestone Aug 4, 2023
@yezizp2012 yezizp2012 modified the milestones: release-1.2, release-1.3 Sep 11, 2023
@yezizp2012 yezizp2012 modified the milestones: release-1.3, release-1.4 Oct 10, 2023
@yezizp2012 yezizp2012 changed the title feat(frontend): support sasl authentication in frontend discussion: enable OAuth2 authentication for risingwave Oct 20, 2023
@yezizp2012
Copy link
Member Author

Cc @xuhui-lu .

Copy link
Contributor

This issue has been open for 60 days with no activity. Could you please update the status? Feel free to continue discussion or close as not planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issues that need help from contributors no-issue-activity type/feature
Projects
None yet
Development

No branches or pull requests

2 participants