Struct webex::auth::DeviceAuthenticator
source · 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 Send for DeviceAuthenticator
impl Sync for DeviceAuthenticator
impl Unpin for DeviceAuthenticator
impl !UnwindSafe 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