-
Notifications
You must be signed in to change notification settings - Fork 315
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
Proper support for alternate auth accounts #807
Comments
Or maybe instead of separate configs per account, the config.toml structure should change to support e.g. [accounts."account1@domain".calendars]
ignore-calendars = ["cal1", "cal2"] ? |
I hit one snag that the oauth tokens we receive don't seem to include an account name or email to identify separate accounts. It seemed like the Alternatively we could just let users manually name the accounts and store one unnamed one as "default", like: $ gcalcli init
…
Successfully loaded credentials for account "default".
$ gcalcli init --account=work
…
Successfully loaded credentials for account "work". |
K for reference, I was able to successfully fetch account ID / email using their recommended way from google_auth_oauthlib docs: flow = InstalledAppFlow.from_client_config(
…
scopes=[
"openid",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/calendar",
],
)
session = flow.authorized_session()
profile_info = session.get(
'https://www.googleapis.com/userinfo/v2/me').json() but I can't figure out how to get it to require multiple scopes like that w/o the annoying checkboxes and am leaning towards just letting users explicitly assign names to the accounts like |
I like the idea of using an |
This seems unnecessarily complicated to me. Having a different toml files for each account is a lot easier to understand. If you want to avoid duplication in configuration, it maybe be better to have |
Eh, could be I'm overcomplicating things. My priority in however it's specified is to remove any temptation for people to manually twiddle oauth files, so we're not locked into some implied contract of where these files need to live. How would these "config.toml" and "other.toml" files be specified when you're invoking gcalcli though? |
For
|
Might work okay. I suspect that'd also end up having a lot of complications in practice:
Granted these are all details that need to be figured out for pretty much any strategy, but could start getting really messy really fast using implicit mappings or magic names. |
I agree with In an ideal world, if I ran Ultimately, I'd think that the |
Upon reflection I think
Good idea! Should be |
K then a few things:
BTW the recommended way of pointing to an explicit config file / dir is |
I also realized |
There should be a convenient way for users to switch between different authenticated accounts in gcalcli.
Currently this can be done by twiddling oauth files (see #805), but the mechanism is clunky and not very discoverable. The ideal would probably be to have a set of named auth accounts and to be able to configure
--account=someaccount@domain
in cli args and config files.The text was updated successfully, but these errors were encountered: