Add google redirect URI constants
This commit is contained in:
parent
0140f5d1df
commit
2b6f159aa8
|
@ -3,13 +3,13 @@ extern crate inth_oauth2;
|
||||||
use std::io;
|
use std::io;
|
||||||
|
|
||||||
use inth_oauth2::Client;
|
use inth_oauth2::Client;
|
||||||
use inth_oauth2::provider::google::Installed;
|
use inth_oauth2::provider::google::{Installed, REDIRECT_URI_OOB};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let client = Client::<Installed>::new(
|
let client = Client::<Installed>::new(
|
||||||
String::from("143225766783-ip2d9qv6sdr37276t77luk6f7bhd6bj5.apps.googleusercontent.com"),
|
String::from("143225766783-ip2d9qv6sdr37276t77luk6f7bhd6bj5.apps.googleusercontent.com"),
|
||||||
String::from("3kZ5WomzHFlN2f_XbhkyPd3o"),
|
String::from("3kZ5WomzHFlN2f_XbhkyPd3o"),
|
||||||
Some(String::from("urn:ietf:wg:oauth:2.0:oob"))
|
Some(String::from(REDIRECT_URI_OOB)),
|
||||||
);
|
);
|
||||||
|
|
||||||
let auth_uri = client.auth_uri(Some("https://www.googleapis.com/auth/userinfo.email"), None)
|
let auth_uri = client.auth_uri(Some("https://www.googleapis.com/auth/userinfo.email"), None)
|
||||||
|
|
|
@ -43,6 +43,21 @@ pub mod google {
|
||||||
use token::{Bearer, Expiring, Refresh};
|
use token::{Bearer, Expiring, Refresh};
|
||||||
use super::Provider;
|
use super::Provider;
|
||||||
|
|
||||||
|
/// Signals the server to return the authorization code by prompting the user to copy and
|
||||||
|
/// paste.
|
||||||
|
///
|
||||||
|
/// See [Choosing a redirect URI][uri].
|
||||||
|
///
|
||||||
|
/// [uri]: https://developers.google.com/identity/protocols/OAuth2InstalledApp#choosingredirecturi
|
||||||
|
pub const REDIRECT_URI_OOB: &'static str = "urn:ietf:wg:oauth:2.0:oob";
|
||||||
|
|
||||||
|
/// Signals the server to return the authorization code in the page title.
|
||||||
|
///
|
||||||
|
/// See [Choosing a redirect URI][uri].
|
||||||
|
///
|
||||||
|
/// [uri]: https://developers.google.com/identity/protocols/OAuth2InstalledApp#choosingredirecturi
|
||||||
|
pub const REDIRECT_URI_OOB_AUTO: &'static str = "urn:ietf:wg:oauth:2.0:oob:auto";
|
||||||
|
|
||||||
/// Google OAuth 2.0 provider for web applications.
|
/// Google OAuth 2.0 provider for web applications.
|
||||||
///
|
///
|
||||||
/// See [Using OAuth 2.0 for Web Server
|
/// See [Using OAuth 2.0 for Web Server
|
||||||
|
|
Loading…
Reference in New Issue