-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[REST Catalog] OAuth 2 grant type "refresh_token" not implemented #12196
Comments
@nika-qubit I think you're confusing two separate things here. The token exchange flow is used by the current implementation to provide a way to get a new token using a valid token. While this is not commonly used, I'm not aware of how the current implementation violates the RFC. The current implementation does not support the refresh token flow at all (secion-6 you state is implemented incorrectly). I feel like you should change this to state that you would like refresh token to be supported and tag this as a feature request. |
Thanks, @danielcweeks. Yes, I was confused by the "refreshToken" method naming. It's actually doing token-exchange and the oauth server that I'm interacting with doesn't support this grant type. I would like to make the issue a FR for supporting the refreshing token flow. Edited the statement, please help me change the labels from "bug" to "improvement". |
Supported refreshing token using the refresh token flow in addition to token exchange flow for OAuth2. Closes apache#12196
Supported refreshing token using the refresh token flow in addition to token exchange flow for OAuth2. Closes apache#12196
Supported refreshing token using the refresh token flow in addition to token exchange flow for OAuth2. Closes apache#12196
Supported refreshing token using the refresh token flow in addition to token exchange flow for OAuth2. Closes apache#12196
Supported refreshing token using the refresh token flow in addition to token exchange flow for OAuth2. Closes apache#12196
Supported refreshing token using the refresh token flow in addition to token exchange flow for OAuth2. Closes apache#12196
Supported refreshing token using the refresh token flow in addition to token exchange flow for OAuth2. Closes apache#12196
Supported refreshing token using the refresh token flow in addition to token exchange flow for OAuth2. Closes apache#12196
Supported refreshing token using the refresh token flow in addition to token exchange flow for OAuth2. Closes apache#12196
PR opened: #12362 Rebased to the latest main HEAD at this moment. Added test is |
Could someone please review it? Thanks! |
Hi, I support this feature request and think this is a great idea. I can confirm that support for external IDPs is currently broken, as token refreshes generally do not work. There are a few reasons for that:
We could argue that reason 1 above is a "feature request", but I would qualify reason 2 as a bug. |
To expand a bit on why using bearer authentication to refresh tokens should be considered a bug, and a violation of the OAuth2 spec: A client is not supposed to authenticate against the tokens endpoint using a bearer token that it obtained previously from that same endpoint. According to RFC 6749 section 2.3, valid authentication methods that IDPs must support include: HTTP Basic header (preferred), or client ID + client secret included in the POST request body. In any case, the request must include the client ID and the client secret. But a typical token refresh request issued by the Iceberg REST client looks like this (slightly arranged for readability):
Note how it does NOT include the client ID and client secret, and how it uses "bearer token" authentication instead of "basic". Keycloak and Auth0 both respond with a 401 response. Keycloak also logs a warning:
|
Apache Iceberg version
1.7.1 (latest release)
Query engine
None
Feature Request / Improvement
For the REST Catalog service (after deprecating the oauth endpoint), the refresh token flow (https://datatracker.ietf.org/doc/html/rfc6749#section-6) is not supported yet. The current supported flow is "token-exchange" and used as a way to refresh tokens: https://github.com/apache/iceberg/blob/main/core/src/main/java/org/apache/iceberg/rest/auth/OAuth2Util.java#L163.
The refresh token flow should be taking in:
A proposal to support this flow is to allow providing:
through properties similar to credential or token to work together with the oauth2-server-uri property.
Willingness to contribute
The text was updated successfully, but these errors were encountered: