pub struct DeviceAuthenticator { /* private fields */ }Expand description
Authenticates a device based on a Webex Integration “client id” and a “client secret”.
More information can be found on https://developer.webex.com/docs/login-with-webex#device-grant-flow.
Implementations§
Source§impl DeviceAuthenticator
impl DeviceAuthenticator
Sourcepub fn new(id: &str, secret: &str) -> Self
pub fn new(id: &str, secret: &str) -> Self
Creates a new DeviceAuthenticator using the “client ID” and
“client secret” provided by a Webex Integration.
For more details: https://developer.webex.com/docs/integrations.
Sourcepub async fn verify(&self) -> Result<VerificationToken, Error>
pub async fn verify(&self) -> Result<VerificationToken, Error>
First step of device authentication. Returns a VerificationToken
containing the codes and URLs that can be entered and navigated to
on a different device.
Sourcepub async fn wait_for_authentication(
&self,
verification_token: &VerificationToken,
) -> Result<Bearer, Error>
pub async fn wait_for_authentication( &self, verification_token: &VerificationToken, ) -> Result<Bearer, Error>
Second and final step of device authentication. Receives a VerificationToken
provided by verify and blocks until the user enters their crendentials using
the provided codes/links from VerificationToken. Returns a Bearer if successful.
Auto Trait Implementations§
impl !RefUnwindSafe for DeviceAuthenticator
impl !UnwindSafe for DeviceAuthenticator
impl Freeze for DeviceAuthenticator
impl Send for DeviceAuthenticator
impl Sync for DeviceAuthenticator
impl Unpin for DeviceAuthenticator
impl UnsafeUnpin for DeviceAuthenticator
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