IdConfiguration

Struct IdConfiguration 

Source
pub struct IdConfiguration { /* private fields */ }
Expand description

Implementations§

Source§

impl IdConfiguration

Source

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());
Source

pub fn set_auto_select(&mut self, auto_select: bool)

Source

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());
}));
Source

pub fn set_login_uri(&mut self, login_uri: String)

Source

pub fn set_native_callback(&mut self, native_callback: Box<dyn Fn(Credential)>)

Source

pub fn set_cancel_on_tap_outside(&mut self, cancel_on_tap_outside: bool)

Source

pub fn set_prompt_parent_id(&mut self, prompt_parent_id: String)

Source

pub fn set_nonce(&mut self, nonce: String)

Source

pub fn set_context(&mut self, context: String)

Source

pub fn set_ux_mode(&mut self, ux_mode: UxMode)

Source

pub fn set_allowed_parent_origin( &mut self, allowed_parent_origin: Box<[String]>, )

Source

pub fn set_itp_support(&mut self, itp_support: bool)

Source

pub fn set_login_hint(&mut self, login_hint: String)

Source

pub fn set_hd(&mut self, hd: String)

Source

pub fn set_use_fedcm_for_prompt(&mut self, use_fedcm_for_prompt: bool)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.