Skip to content
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

Make the OAuth2 request scope configurable #462

Closed
flyrain opened this issue Feb 22, 2024 · 3 comments
Closed

Make the OAuth2 request scope configurable #462

flyrain opened this issue Feb 22, 2024 · 3 comments

Comments

@flyrain
Copy link
Contributor

flyrain commented Feb 22, 2024

Feature Request / Improvement

OAuth2 Scope is a mechanism to limit an application's access to a user's account. It can also be used to ask for more information like openId user profile(id, name, email, etc). The user profile is useful for ACL checking in the server side. Currently PyIceberg hard-codes it to catalog, which cannot support the use case above. I'd suggest to make it configurable. WDYT? cc @Fokko @danielcweeks @syun64 @RussellSpitzer

Here is an http request example for better understanding.

curl --request POST \
  --url https://xxx.com/oauth2/token \
  --header 'Authorization: Basic xxx' \
  --header 'content-type: multipart/form-data' \
  --form grant_type=client_credentials \
  --form 'scope=openid offline corpds:ds:profile' \

Then the token in response will have the user profile like this:

corpds:ds:dsid=2321321, corpds:ds:email=abot44@xxx.com, corpds:ds:employeeType=D, corpds:ds:firstName=Bot1
@sungwy
Copy link
Collaborator

sungwy commented Feb 22, 2024

Hi @flyrain thanks for raising this. I just took a look into the Java code, and the scope already seems to be configurable there.

Would you like to put up a PR here to make it similarly configurable?

Related PR: apache/iceberg#6616

@flyrain
Copy link
Contributor Author

flyrain commented Feb 22, 2024

Thanks for conform, @syun64 . Glad it was taken care in Java.

@Fokko
Copy link
Contributor

Fokko commented Mar 5, 2024

#484 went in, closing this one 👍

@Fokko Fokko closed this as completed Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants