Skip to content

[MINOR] docs: Add OAuth2 token refresh guidance#11079

Open
lasdf1234 wants to merge 22 commits into
apache:mainfrom
lasdf1234:docs/oauth2-token-refresh
Open

[MINOR] docs: Add OAuth2 token refresh guidance#11079
lasdf1234 wants to merge 22 commits into
apache:mainfrom
lasdf1234:docs/oauth2-token-refresh

Conversation

@lasdf1234
Copy link
Copy Markdown
Contributor

@lasdf1234 lasdf1234 commented May 14, 2026

What changes were proposed in this pull request?

Add OAuth 2.0 token refresh guidance to docs/security/how-to-authenticate.md, including Iceberg 1.11.0+ behavior, Spark/Flink token exchange settings, Trino catalog settings, and an alternative Dremio auth manager section for Spark and Flink.

Why are the changes needed?

Users need clear guidance for handling OAuth 2.0 token refresh and token exchange behavior when connecting engines to Gravitino Iceberg REST Catalog.

Fixes #11092

Does this PR introduce any user-facing change?

Yes. Documentation now includes OAuth 2.0 token refresh guidance for Spark, Flink, and Trino.

How was this patch tested?

Documentation update only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 14, 2026 01:36
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/security/how-to-authenticate.md Outdated

| Version | Change |
| --- | --- |
| Iceberg 1.11.0+ | Supports disabling token exchange and using client credentials for token renewal, and fixes child `AuthSession` expiration handling so the child session uses its own token lifetime. |
Copy link
Copy Markdown
Contributor

@danhuawang danhuawang May 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the gravitino IRC upgrade to the 1.11.0? If gravitino IRC is still 1.10, can we clarify it here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need. This parameter takes effect on the client side.

Comment thread docs/security/how-to-authenticate.md Outdated
spark.executor.extraClassPath=${SPARK_HOME}/jars/authmgr-oauth2-runtime-<version>.jar
```

Example Spark configuration using client credentials token refresh:
Copy link
Copy Markdown
Contributor

@danhuawang danhuawang May 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also add an example for spark.sql.catalog.remote_irc_b.rest.auth.oauth2.grant-type password, this type make more sense.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got spark and flink have both added usage examples

Comment thread docs/security/how-to-authenticate.md Outdated
spark.sql.catalog.irc=org.apache.iceberg.spark.SparkCatalog
spark.sql.catalog.irc.type=rest
spark.sql.catalog.irc.uri=http://localhost:9001/iceberg/
spark.sql.catalog.irc.warehouse=<catalog_name>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is spark.sql.catalog.gravitino_irc_b_mysql_backend.prefix <catalog_name> required?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got, this configuration is not related to the main theme of this document.I have removed this config.

Comment thread docs/security/how-to-authenticate.md Outdated

#### OAuth 2.0 token refresh for Iceberg REST clients

When Gravitino is used as an Iceberg REST Catalog (IRC), some query engines may hit OAuth 2.0 token refresh issues during long-running sessions.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

during long-running sessions, if the token expiration time is 5s , then it happens in short time. So propose remove long-running .

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got I already revised the document.

lasdf1234 and others added 4 commits May 14, 2026 17:01
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@roryqi roryqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add the document to iceberg-rest-service.md instead of security.md.

Comment thread docs/security/how-to-authenticate.md Outdated
For the native Apache Iceberg OAuth 2.0 implementation, the following upstream improvement is relevant:

| Version | Change |
| --- | --- |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could u fix the format?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got resolved

Comment thread docs/security/how-to-authenticate.md Outdated

##### Alternative OAuth 2.0 auth manager

If the native Apache Iceberg OAuth 2.0 implementation does not meet your requirements, you can use the Dremio Iceberg OAuth 2.0 auth manager.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't get your point. When will we need to use Dremio library?

lasdf1234 and others added 2 commits May 14, 2026 17:48
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/security/how-to-authenticate.md Outdated

##### Alternative Dremio Iceberg OAuth 2.0 auth manager

If version of iceberg on the client side can't be upgraded, you can use the Dremio Iceberg OAuth 2.0 auth manager as an alternative.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Iceberg library is usually compatible. I don't think this is a good reason.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content of Dermio has been deleted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/security/how-to-authenticate.md Outdated
For the native Apache Iceberg OAuth 2.0 implementation, the following upstream improvement is relevant:

| Version | Change |
| --- | --- |
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format the table.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got resolved

lasdf1234 and others added 4 commits May 14, 2026 18:06
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread docs/iceberg-rest-service.md Outdated
|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Iceberg 1.11.0+ | Supports disabling token exchange, using client credentials for token renewal, and fixing child `AuthSession` expiration handling so that child sessions use their own token lifetime. |

###### Native Apache Iceberg OAuth 2.0 implementation
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could u remove native?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got resolved

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 14, 2026

Code Coverage Report

Overall Project 66.07% 🟢
Files changed No Java source files changed -

Module Coverage
aliyun 1.72% 🔴
api 47.13% 🟢
authorization-common 85.96% 🟢
aws 1.08% 🔴
azure 2.47% 🔴
catalog-common 10.2% 🔴
catalog-fileset 80.02% 🟢
catalog-glue 83.41% 🟢
catalog-hive 81.83% 🟢
catalog-jdbc-clickhouse 79.18% 🟢
catalog-jdbc-common 43.93% 🟢
catalog-jdbc-doris 80.28% 🟢
catalog-jdbc-hologres 54.03% 🟢
catalog-jdbc-mysql 79.23% 🟢
catalog-jdbc-oceanbase 78.38% 🟢
catalog-jdbc-postgresql 82.05% 🟢
catalog-jdbc-starrocks 78.27% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 45.14% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 86.98% 🟢
catalog-lakehouse-paimon 76.85% 🟢
catalog-model 77.72% 🟢
cli 44.51% 🟢
client-java 77.96% 🟢
common 50.0% 🟢
core 82.29% 🟢
filesystem-hadoop3 76.97% 🟢
flink 0.0% 🔴
flink-common 43.17% 🟢
flink-runtime 0.0% 🔴
gcp 14.12% 🔴
hadoop-common 10.39% 🔴
hive-metastore-common 46.83% 🟢
iceberg-common 55.46% 🟢
iceberg-rest-server 69.61% 🟢
idp-basic 94.68% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 19.95% 🔴
lance-rest-server 62.78% 🟢
lineage 53.02% 🟢
optimizer 82.95% 🟢
optimizer-api 21.95% 🔴
server 85.83% 🟢
server-common 71.23% 🟢
spark 32.79% 🔴
spark-common 39.09% 🔴
trino-connector 35.14% 🔴

Comment thread docs/iceberg-rest-service.md Outdated
Some query engines may encounter OAuth 2.0 token refresh issues when connecting to Gravitino as an Iceberg REST Catalog (IRC).
This usually occurs when the identity provider does not support token exchange, or when a child authentication session inherits the parent session's expiration time.

For the native Apache Iceberg OAuth 2.0 implementation, the following upstream improvement is relevant:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

native.

Comment thread docs/iceberg-rest-service.md Outdated
##### OAuth 2.0 token refresh for Iceberg REST clients

Some query engines may encounter OAuth 2.0 token refresh issues when connecting to Gravitino as an Iceberg REST Catalog (IRC).
This usually occurs when the identity provider does not support token exchange, or when a child authentication session inherits the parent session's expiration time.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It usually occurs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got resolved

lasdf1234 and others added 5 commits May 14, 2026 19:19
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lasdf1234 and others added 2 commits May 14, 2026 20:53
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roryqi
roryqi previously approved these changes May 14, 2026
Copy link
Copy Markdown
Contributor

@roryqi roryqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

[Improvement] Document OAuth2 token refresh guidance for Iceberg REST clients

4 participants