diqiu50 opened a new issue, #13933:
URL: https://github.com/apache/gravitino/issues/13933

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   `IcebergRestOAuthConfig.resolve` passes the connector's OAuth2 client 
credentials to the auto-routed Iceberg REST client. With 
`spark.sql.gravitino.authType=basic` it passes nothing. A routed Iceberg 
catalog then connects to the Iceberg REST service without credentials. The user 
has to repeat the same user name and password under 
`spark.sql.gravitino.iceberg.rest.rest.auth.*`.
   
   Expected: a Spark session using Basic auth can read routed Iceberg catalogs 
without extra Iceberg REST settings, as an OAuth2 session can.
   
   ### Error message and/or stacktrace
   
   `NotAuthorizedException` when the routed catalog fetches its config from an 
Iceberg REST service that requires authentication.
   
   ### How to reproduce
   
   1. Start an Iceberg REST service that requires authentication.
   2. Start Spark with `spark.sql.gravitino.authType=basic`, plus 
`spark.sql.gravitino.basic.username` and `spark.sql.gravitino.basic.password`.
   3. Query a Hive- or JDBC-backed Iceberg catalog that Gravitino routes to the 
Iceberg REST service.
   4. The query fails with `NotAuthorizedException`.
   
   ### Additional context
   
   Suggested fix: when `authType=basic` and no `rest.auth.*` property is set 
explicitly, set `rest.auth.type=basic` and pass the Gravitino user name and 
password as the Iceberg REST basic credentials. Explicit settings keep priority.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to