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

Provide a method to write User Credentials to file #54

Closed
ajkannan opened this issue Dec 16, 2015 · 5 comments
Closed

Provide a method to write User Credentials to file #54

ajkannan opened this issue Dec 16, 2015 · 5 comments
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@ajkannan
Copy link

It would be helpful to give users the ability to generate a User Credentials JSON file. While this is a feature of Python's auth library, the only way users can get a User Credentials JSON file now is to login using the Google Cloud SDK and then go hunting for it in the configurations directory.

@tswast
Copy link
Contributor

tswast commented Jul 13, 2017

There's already a TokenStore interface which seems to be intended for this purpose, but no concrete implementation is provided.

@YuryBandarchuk16
Copy link
Contributor

YuryBandarchuk16 commented Sep 13, 2017

Hello! Can I work on this enhancement?

Which kind of TokenStore implementation would you like me to do? Any database (PostGreSQL, MongoDB) for storing and then loading back or just in file for storing? Just want to make sure I understand what is needed so that I can start working on it.

Thanks!

@tswast
Copy link
Contributor

tswast commented Sep 13, 2017

Contributions welcome! Per the contributions document, before we can accept a pull request from you, we'll need a signed CLA.

For the first implementation, we'd probably want an in-memory version. Basically just enough to have a working TokenStore implementation. That way an application could use user authentication but would have to re-authenticate every time.

Second, I'd want something that can save refresh tokens to a JSON file in a configuration directory. It's a different language, but something similar to what is done in the Pandas-GBQ library: https://github.com/pydata/pandas-gbq/blob/dbfb4e92d4b26fe5cff6c22e9ae420b324b8ac5a/pandas_gbq/gbq.py#L304

@YuryBandarchuk16
Copy link
Contributor

@tswast There is my PR for this issue - #129

Instead of only having the refresh tokens, I store a few other things. The implementation works in such way, so that if you call the method that saves userCredentials, it will overwrite everything what existed before. Let me know if you would like any changes.

@chingor13
Copy link
Contributor

This appears to have been fixed in #129 by with OAuth2Utils.writeInputStreamToFile() and UserCredentials.save().

Closing this out, but feel free to re-open if this is not the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

6 participants