pub struct OidcDeviceAuthorization {
pub handle: SecretString,
pub binding: SecretString,
pub user_code: String,
pub verification_uri: String,
pub verification_uri_complete: Option<String>,
pub interval_secs: u64,
pub expires_by: u64,
}Expand description
A begun device sign-in through the identity provider (RFC 8628, issue #635).
The platform shows the person user_code and verification_uri — or renders
verification_uri_complete as a link or QR code — and polls
AuthClient::poll_oidc_device_login with this value, waiting interval_secs before the
first poll and between every poll, until it answers something other than
OidcDevicePoll::Pending or expires_by passes. On OidcDevicePoll::SlowDown, call
slow_down before waiting again.
Keep it as an OidcAuthorization is kept: the binding is what the server checks on every
poll, and only its hash was sent. No Debug: the handle and the binding are a live credential.
Fields§
§handle: SecretStringThe handle the server polls the provider under. The server’s own; not the device code.
binding: SecretStringThe secret binding the ceremony to this client: 256 random bits, unpadded base64url.
user_code: StringThe code the person types at the verification page. Show it exactly.
verification_uri: StringWhere the person goes, on any device with a browser, to type the code.
verification_uri_complete: Option<String>The same address with the code already in it, when the provider offers one.
interval_secs: u64How many seconds to wait before each poll, raised by slow_down.
expires_by: u64The absolute Unix-seconds instant the ceremony stops being honoured.
Implementations§
Source§impl OidcDeviceAuthorization
impl OidcDeviceAuthorization
Sourcepub fn slow_down(&mut self)
pub fn slow_down(&mut self)
Raise the interval by DEVICE_SLOW_DOWN_STEP_SECS, as RFC 8628 §3.5 requires on every
slow_down — the server did the same, so the two stay in step.
Auto Trait Implementations§
impl Freeze for OidcDeviceAuthorization
impl RefUnwindSafe for OidcDeviceAuthorization
impl Send for OidcDeviceAuthorization
impl Sync for OidcDeviceAuthorization
impl Unpin for OidcDeviceAuthorization
impl UnsafeUnpin for OidcDeviceAuthorization
impl UnwindSafe for OidcDeviceAuthorization
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more