Skip to content
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

feat(csharp/src/Drivers/Apache/Spark): Add OAuth access token auth type to Csharp Spark Driver #2579

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

eric-wang-1990
Copy link

@eric-wang-1990 eric-wang-1990 commented Mar 6, 2025

Introduce a new OAuth type for adbc.spark.auth_type as oauth.
Introduce a new parameter adbc.spark.access_token which accept the pass through OAuth access token.
Closes #2578

@eric-wang-1990 eric-wang-1990 changed the title add oauth access token Add OAuth access token auth type to Csharp Spark Driver Mar 6, 2025
@eric-wang-1990 eric-wang-1990 changed the title Add OAuth access token auth type to Csharp Spark Driver feat(csharp/src/Drivers/Apache/Spark): Add OAuth access token auth type to Csharp Spark Driver Mar 6, 2025
@@ -205,6 +214,10 @@ private HttpClientHandler NewHttpClientHandler()
{
return new AuthenticationHeaderValue(BasicAuthenticationScheme, Convert.ToBase64String(Encoding.UTF8.GetBytes($"{username}:")));
}
else if (!string.IsNullOrEmpty(access_token) && authType == SparkAuthType.OAuth)
{
return new AuthenticationHeaderValue(BearerAuthenticationScheme, access_token);
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like mechanically, the only difference between token and oauth are the names and values of the connection parameters; an adbc.spark.auth_type of token with an adbc.spark.token property produces an identical outcome as an 'adbc.spark.auth_typeofoauthwith anadbc.spark.access_token` property. Is this expected?

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.

csharp/src/Drivers/Apache/Spark: Support OAuth access token passthrough type
3 participants