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

Creating Connection object using valid OAuth2 access token #29

Closed
jeffersonatsafe opened this issue Jan 13, 2020 · 0 comments · Fixed by #37
Closed

Creating Connection object using valid OAuth2 access token #29

jeffersonatsafe opened this issue Jan 13, 2020 · 0 comments · Fixed by #37
Assignees
Labels
api: spanner Issues related to the googleapis/java-spanner-jdbc API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@jeffersonatsafe
Copy link

jeffersonatsafe commented Jan 13, 2020

Is your feature request related to a problem? Please describe.
I have set up OAuth2 and am able to receive valid access token for cloud spanner. However, I'm unable to use it to form a proper Connection object using the jdbc driver. The JdbcDriver.connect() method only accepts url for a credentials file.

Describe the solution you'd like
I'd like for JdbcDriver.connect(String url, Properties info) to accept oauth token in its Properties parameter.

Describe alternatives you've considered
by not specifying any credentials, the default credentials of the environment as returned by GoogleCredentials.getApplicationDefault() will be used. However, this also requires a json file, and does not use an access token.

Additional Notes
this is the same request as olavloite/spanner-jdbc#6

@jeffersonatsafe jeffersonatsafe changed the title Creating Connection object using valid access token Creating Connection object using valid OAuth2 access token Jan 13, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jan 14, 2020
@olavloite olavloite added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed triage me I really want to be triaged. labels Jan 16, 2020
@olavloite olavloite self-assigned this Jan 20, 2020
olavloite added a commit that referenced this issue Jan 21, 2020
Allow the user to specify an existing OAuth token to use for a JDBC connection,
instead of requiring the user to specify a credentials file or using the default
credentials of the environment.

Fixes #29
olavloite added a commit that referenced this issue Jan 22, 2020
* feat: allow using existing OAuth token for JDBC connection

Allow the user to specify an existing OAuth token to use for a JDBC connection,
instead of requiring the user to specify a credentials file or using the default
credentials of the environment.

Fixes #29

* tests: fix test cases

* fix: remove unused method

* fix: use default credentials when no file found

* fix: fix faulty merge
@google-cloud-label-sync google-cloud-label-sync bot added the api: spanner Issues related to the googleapis/java-spanner-jdbc API. label Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner-jdbc API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants