dermesser / yup-oauth2

An oauth2 client implementation providing the Device, Installed, Service Account, and several more flows.
https://docs.rs/yup-oauth2/
Apache License 2.0
213 stars 114 forks source link

Add an option to force the User to choose an Account #205

Closed OMGeeky closed 12 months ago

OMGeeky commented 1 year ago

This option on the Installed flow forces the user to select an account when authorizing. This way the user can login with Account A for something and Account B for something else, while not having to delete the tokens that are stored somewhere and allowing for multiple simultaneous logins.

I only implemented this for the Installed flow, maybe other flows could benefit from that too, I did not check.

dermesser commented 1 year ago

This assumes different scopes for the different accounts, right - so that the tokens are not overwritten? Thank you for the PR!

OMGeeky commented 1 year ago

Either that or they are stored in different files so they don't overlap at all by giving them each a different .persist_tokens_to_disk(path) generated with an internal user id (in my case they might have different scopes, but not necessarily)

OMGeeky commented 1 year ago

If you need me to do anything more for this to be merged, I'd be happy to help.

dermesser commented 12 months ago

Thank you for your patience, I had some busy weeks :-)