pub struct OAuth2Client { /* private fields */ }Expand description
OAuth2 客户端
Implementations§
Source§impl OAuth2Client
impl OAuth2Client
Sourcepub fn new(config: OAuth2ClientConfig) -> OAuth2Result<Self>
pub fn new(config: OAuth2ClientConfig) -> OAuth2Result<Self>
Sourcepub async fn exchange_code(
&self,
code: &str,
code_verifier: Option<&str>,
) -> OAuth2Result<TokenResponse>
pub async fn exchange_code( &self, code: &str, code_verifier: Option<&str>, ) -> OAuth2Result<TokenResponse>
Sourcepub async fn refresh_token(
&self,
refresh_token: &str,
) -> OAuth2Result<TokenResponse>
pub async fn refresh_token( &self, refresh_token: &str, ) -> OAuth2Result<TokenResponse>
Sourcepub async fn get_user_info(&self, access_token: &str) -> OAuth2Result<UserInfo>
pub async fn get_user_info(&self, access_token: &str) -> OAuth2Result<UserInfo>
Sourcepub async fn revoke_token(
&self,
token: &str,
token_type_hint: Option<&str>,
) -> OAuth2Result<()>
pub async fn revoke_token( &self, token: &str, token_type_hint: Option<&str>, ) -> OAuth2Result<()>
Sourcepub fn validate_state(&self, expected: &str, received: &str) -> OAuth2Result<()>
pub fn validate_state(&self, expected: &str, received: &str) -> OAuth2Result<()>
Sourcepub fn provider_name(&self) -> &str
pub fn provider_name(&self) -> &str
获取提供者名称
Sourcepub fn config(&self) -> &OAuth2ClientConfig
pub fn config(&self) -> &OAuth2ClientConfig
获取配置
Trait Implementations§
Source§impl Clone for OAuth2Client
impl Clone for OAuth2Client
Source§fn clone(&self) -> OAuth2Client
fn clone(&self) -> OAuth2Client
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 moreAuto Trait Implementations§
impl Freeze for OAuth2Client
impl RefUnwindSafe for OAuth2Client
impl Send for OAuth2Client
impl Sync for OAuth2Client
impl Unpin for OAuth2Client
impl UnsafeUnpin for OAuth2Client
impl UnwindSafe for OAuth2Client
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