pub struct DeviceCode {
pub expires: DateTime<Utc>,
pub user_code: String,
pub verification_uri: String,
pub verification_uri_complete: Option<String>,
/* private fields */
}Available on crate feature
device-code only.Fields§
§expires: DateTime<Utc>§user_code: String§verification_uri: String§verification_uri_complete: Option<String>Implementations§
Source§impl DeviceCode
impl DeviceCode
Sourcepub async fn request(
issuer: &str,
client_id: String,
) -> Result<Self, RauthyError>
pub async fn request( issuer: &str, client_id: String, ) -> Result<Self, RauthyError>
Request a device_code from your Rauthy instance.
This code can then be used in exchange for an OIDC Token Set.
Clients requesting device_code’s are typically public. If you have a confidential
client or need additional configuration, use DeviceCode::request_with().
Sourcepub async fn request_with(
issuer: &str,
client_id: String,
client_secret: Option<String>,
scope: Option<&str>,
root_certificate: Option<RootCertificate>,
https_only: RauthyHttpsOnly,
danger_insecure: DangerAcceptInvalidCerts,
) -> Result<Self, RauthyError>
pub async fn request_with( issuer: &str, client_id: String, client_secret: Option<String>, scope: Option<&str>, root_certificate: Option<RootCertificate>, https_only: RauthyHttpsOnly, danger_insecure: DangerAcceptInvalidCerts, ) -> Result<Self, RauthyError>
Request a device_code from your Rauthy instance.
This code can then be used in exchange for an OIDC Token Set.
Sourcepub async fn wait_for_token(&mut self) -> Result<OidcTokenSet, RauthyError>
pub async fn wait_for_token(&mut self) -> Result<OidcTokenSet, RauthyError>
With a valid device_code, continuously poll the Rauthy instance and wait
for user verification of your request, to get an OIDC Token Set.
Trait Implementations§
Source§impl Debug for DeviceCode
impl Debug for DeviceCode
Auto Trait Implementations§
impl !RefUnwindSafe for DeviceCode
impl !UnwindSafe for DeviceCode
impl Freeze for DeviceCode
impl Send for DeviceCode
impl Sync for DeviceCode
impl Unpin for DeviceCode
impl UnsafeUnpin for DeviceCode
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