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

feat(flows): Implement flow for installed apps #21

Merged
merged 5 commits into from
May 20, 2016
Merged

feat(flows): Implement flow for installed apps #21

merged 5 commits into from
May 20, 2016

Conversation

dermesser
Copy link
Owner

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

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);
Copy link
Collaborator

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().

Copy link
Owner Author

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)

@Byron Byron self-assigned this Apr 23, 2016
@Byron Byron added this to the 1.0.0 milestone Apr 23, 2016
@Byron
Copy link
Collaborator

Byron commented Apr 23, 2016

Thank you so much for these flows ! They have been on my 'want-to-have' list for a long time now !
If it wasn't for the single TODO, I would happily merge it.
Also I would be interested in learning how you manage to compile it, as I am having trouble with it (see #19 for more).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants