-
Notifications
You must be signed in to change notification settings - Fork 115
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(flows): Implement flow for installed apps #21
Conversation
The "Installed App Flow" requires user interaction; we first generate a URL that the user has to navigate to. Then, the user either pastes a displayed code into the app being authorized, or the OAuth provider redirects the user's browser to a webserver that is running on localhost. This webserver is provided by the library and the flow should work automatically. Extensive documentation can be found here: https://developers.google.com/identity/protocols/OAuth2InstalledApp An example for the InstalledFlow with the Drive API is here: https://gist.github.com/dermesser/8c915ec4c88ee8e8927e7d40b276ca52
This means that in theory other providers besides Google could be used.
url); | ||
|
||
let mut code = String::new(); | ||
let _ = io::stdin().read_line(&mut code); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what the advised style is, but what I am usually doing is this:
io::stdin().read_line(&mut code).ok()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done (with a .map(|_| code)
appended)
Thank you so much for these flows ! They have been on my 'want-to-have' list for a long time now ! |
The Url::query_pairs() function returns a different type now.
Now I got it :-)
The "Installed App Flow" requires user interaction; we first generate a
URL that the user has to navigate to. Then, the user either pastes a
displayed code into the app being authorized, or the OAuth provider
redirects the user's browser to a webserver that is running on
localhost. This webserver is provided by the library and the flow should
work automatically. Extensive documentation can be found here:
https://developers.google.com/identity/protocols/OAuth2InstalledApp
An example for the InstalledFlow with the Drive API is here:
https://gist.github.com/dermesser/8c915ec4c88ee8e8927e7d40b276ca52