Thanks, but I do need this token, so I can send it to another arrow flight server to verify it..
From: David Li <lidav...@apache.org> Date: Monday, September 16, 2024 at 6:54 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? 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://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Farrow%2Fblob%2F38b0c79c85e2835df7d54385bf725d5b060bf81e%2Fjava%2Fflight%2Fflight-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Farrow%2Fflight%2FFlightClient.java%23L197&data=05%7C02%7CChuan.Zhao%40teradata.com%7C941c091db90a48a126de08dcd6bbad3b%7C9151cbaafc6b4f4889bb8c4a71982138%7C0%7C0%7C638621348793077223%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=c3tWitqMDymcWkJaiJWQlAaJTVi%2BXUb65lvynkVAQ3Y%3D&reserved=0<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%7C941c091db90a48a126de08dcd6bbad3b%7C9151cbaafc6b4f4889bb8c4a71982138%7C0%7C0%7C638621348793086397%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=uFT1YNP%2FlMBCGDY30fIAS18ma6gXW4S%2BLjdcPG6IULg%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%7C941c091db90a48a126de08dcd6bbad3b%7C9151cbaafc6b4f4889bb8c4a71982138%7C0%7C0%7C638621348793092649%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=OcI45x8h4MUVbId8XRNLzyhTagF8AJlccK2VMGSmilw%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%7C941c091db90a48a126de08dcd6bbad3b%7C9151cbaafc6b4f4889bb8c4a71982138%7C0%7C0%7C638621348793097833%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=rqTm4odShB6Nrvu3QtaDq4v8TosLtRurQqRTum7rLnU%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 >>> >>>