pub struct OAuthClient<'a> {
pub client_id: &'a str,
pub client_secret: Option<&'a str>,
pub redirect_uri: &'a str,
pub scopes: Vec<String>,
pub token_url: &'a str,
pub auth_url: &'a str,
pub revoke_url: Option<&'a str>,
pub userinfo_url: Option<&'a str>,
pub openid_url: Option<&'a str>,
}
Fields§
§client_id: &'a str
§client_secret: Option<&'a str>
§redirect_uri: &'a str
§scopes: Vec<String>
§token_url: &'a str
§auth_url: &'a str
§revoke_url: Option<&'a str>
§userinfo_url: Option<&'a str>
§openid_url: Option<&'a str>
Implementations§
Source§impl<'a> OAuthClient<'a>
impl<'a> OAuthClient<'a>
pub fn new( client_id: &'a str, redirect_uri: &'a str, auth_url: &'a str, token_url: &'a str, ) -> Self
pub fn set_client_secret(&mut self, client_secret: &'a str) -> Self
pub fn set_openid_url(&mut self, openid_url: &'a str) -> Self
pub fn add_scope(&mut self, scope: &'a str) -> Self
pub async fn get_auth_code(&self) -> Result<String, Box<dyn Error>>
pub async fn get_token( &self, code: &str, ) -> Result<TokenResponse, Box<dyn Error>>
pub async fn get_openid( &self, id_token: &str, ) -> Result<OpenIdResponse, Box<dyn Error>>
Trait Implementations§
Source§impl<'a> Clone for OAuthClient<'a>
impl<'a> Clone for OAuthClient<'a>
Source§fn clone(&self) -> OAuthClient<'a>
fn clone(&self) -> OAuthClient<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for OAuthClient<'a>
impl<'a> Debug for OAuthClient<'a>
Source§impl<'de: 'a, 'a> Deserialize<'de> for OAuthClient<'a>
impl<'de: 'a, 'a> Deserialize<'de> for OAuthClient<'a>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<'a> Freeze for OAuthClient<'a>
impl<'a> RefUnwindSafe for OAuthClient<'a>
impl<'a> Send for OAuthClient<'a>
impl<'a> Sync for OAuthClient<'a>
impl<'a> Unpin for OAuthClient<'a>
impl<'a> UnwindSafe for OAuthClient<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.