It's not exposed. A PR would be welcome. In theory authenticateBasicToken [1] would help but it wraps the value so you can't access it.
[1]: https://github.com/apache/arrow/blob/38b0c79c85e2835df7d54385bf725d5b060bf81e/java/flight/flight-core/src/main/java/org/apache/arrow/flight/FlightClient.java#L197 On Tue, Sep 17, 2024, at 10:18, Zhao, Chuan wrote: > Yes, so what’s the easiest way to send user/password to arrow flight > server then get the token back using Java? > > From: David Li <lidav...@apache.org> > Date: Monday, September 16, 2024 at 5:07 PM > To: Chuan Zhao <chuan.z...@teradata.com.INVALID>, dev@arrow.apache.org > <dev@arrow.apache.org>, felipe...@gmail.com <felipe...@gmail.com> > Subject: Re: [EXTERNAL] Re: How to return auth token back to client? > I think something is getting mixed up here. You are already sending the > token back to the client, but it sounds like the actual question is how > to extract the token from the client? > > I don't believe the JDBC driver offers any way to do this currently. > > On Tue, Sep 17, 2024, at 08:35, Zhao, Chuan wrote: >> Thanks.. I am using Java. In my client I use jdbc to connect to arrow >> flight: >> Java.sql.Connection conn = >> Java.sql.DriverManager.getConnection(jdbcConnectionStr) >> >> Is there a way to get the auth response from conn object? >> >> From: Felipe Oliveira Carvalho <felipe...@gmail.com> >> Date: Monday, September 16, 2024 at 4:10 PM >> To: dev@arrow.apache.org <dev@arrow.apache.org> >> Subject: [EXTERNAL] Re: How to return auth token back to client? >> [You don't often get email from felipe...@gmail.com. Learn why this is >> important at https://aka.ms/LearnAboutSenderIdentification ] >> >> [CAUTION: External Email] >> >> >> In what language are you implementing your Flight service? >> >> For C++ you implement a flight::ServerMiddlewareFactory. That allows you to >> populate response headers with the returned JWT token [1] >> >> -- >> Felipe >> >> [1] >> https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvoltrondata%2Fsqlflite%2Fblob%2Ff8c72976ea9eef7c7de264b7f93da3ae1fa2bcd7%2Fsrc%2Flibrary%2Fsqlflite_security.cpp%23L132&data=05%7C02%7CChuan.Zhao%40teradata.com%7C779a0a41d4ee411ac1ba08dcd6aca6ce%7C9151cbaafc6b4f4889bb8c4a71982138%7C0%7C0%7C638621284233760345%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3i%2FgjcWxkigPZdF33ebYrT9X199a9mobWjb9TeOzhPI%3D&reserved=0<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fvoltrondata%2Fsqlflite%2Fblob%2Ff8c72976ea9eef7c7de264b7f93da3ae1fa2bcd7%2Fsrc%2Flibrary%2Fsqlflite_security.cpp%23L132&data=05%7C02%7CChuan.Zhao%40teradata.com%7C779a0a41d4ee411ac1ba08dcd6aca6ce%7C9151cbaafc6b4f4889bb8c4a71982138%7C0%7C0%7C638621284233772530%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=D3hwhGCpaWXiJLgPo4V30L1%2Ble53FWOQPtV4G9%2FseQw%3D&reserved=0><https://github.com/voltrondata/sqlflite/blob/f8c72976ea9eef7c7de264b7f93da3ae1fa2bcd7/src/library/sqlflite_security.cpp#L132> >> >> On Mon, Sep 16, 2024 at 6:20 PM Zhao, Chuan <chuan.z...@teradata.com.invalid> >> wrote: >> >>> I am implementing JWT authentication with Arrow flight. After the client >>> sends user and password to Arrow flight server, the server with verify the >>> credentials and send a jwt token back to the client. Can someone please >>> tell me how the server sends the token to client? On the server side I can >>> append the token in outgoingHeaders, but I don’t know how to send it to >>> client. Thanks. >>> >>> -Chuan >>> >>>