pub struct IdConfiguration { /* private fields */ }Expand description
Settings for initialize
https://developers.google.com/identity/gsi/web/reference/js-reference#IdConfiguration
Implementations§
Source§impl IdConfiguration
impl IdConfiguration
Sourcepub fn new(client_id: String) -> Self
pub fn new(client_id: String) -> Self
Create a new IdConfiguration with only client_id filled in
use google_signin_client::IdConfiguration;
let configuration = IdConfiguration::new("YOUR_GOOGLE_CLIENT_ID".to_string());Sourcepub fn set_auto_select(&mut self, auto_select: bool)
pub fn set_auto_select(&mut self, auto_select: bool)
Sourcepub fn set_callback(&mut self, callback: Box<dyn Fn(CredentialResponse)>)
pub fn set_callback(&mut self, callback: Box<dyn Fn(CredentialResponse)>)
set a callback for a ID-Token https://developers.google.com/identity/gsi/web/reference/js-reference#callback
use log::info;
use google_signin_client::{IdConfiguration, UxMode};
let mut configuration = IdConfiguration::new("YOUR_GOOGLE_CLIENT_ID".to_string());
configuration.set_ux_mode(UxMode::Popup);
configuration.set_callback(Box::new(move |response| {
info!("Callback received, token: {}", response.credential());
}));Sourcepub fn set_login_uri(&mut self, login_uri: String)
pub fn set_login_uri(&mut self, login_uri: String)
Sourcepub fn set_native_callback(&mut self, native_callback: Box<dyn Fn(Credential)>)
pub fn set_native_callback(&mut self, native_callback: Box<dyn Fn(Credential)>)
Sourcepub fn set_cancel_on_tap_outside(&mut self, cancel_on_tap_outside: bool)
pub fn set_cancel_on_tap_outside(&mut self, cancel_on_tap_outside: bool)
Sourcepub fn set_prompt_parent_id(&mut self, prompt_parent_id: String)
pub fn set_prompt_parent_id(&mut self, prompt_parent_id: String)
Sourcepub fn set_context(&mut self, context: String)
pub fn set_context(&mut self, context: String)
Sourcepub fn set_ux_mode(&mut self, ux_mode: UxMode)
pub fn set_ux_mode(&mut self, ux_mode: UxMode)
Sourcepub fn set_allowed_parent_origin(
&mut self,
allowed_parent_origin: Box<[String]>,
)
pub fn set_allowed_parent_origin( &mut self, allowed_parent_origin: Box<[String]>, )
Sourcepub fn set_itp_support(&mut self, itp_support: bool)
pub fn set_itp_support(&mut self, itp_support: bool)
Sourcepub fn set_login_hint(&mut self, login_hint: String)
pub fn set_login_hint(&mut self, login_hint: String)
Sourcepub fn set_use_fedcm_for_prompt(&mut self, use_fedcm_for_prompt: bool)
pub fn set_use_fedcm_for_prompt(&mut self, use_fedcm_for_prompt: bool)
Auto Trait Implementations§
impl Freeze for IdConfiguration
impl !RefUnwindSafe for IdConfiguration
impl !Send for IdConfiguration
impl !Sync for IdConfiguration
impl Unpin for IdConfiguration
impl !UnwindSafe for IdConfiguration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more