pub enum AuthState {
Unauthenticated,
Challenged {
challenge_type: ChallengeType,
challenge_id: String,
},
MfaRequired,
DeviceVerification {
workflow_id: String,
},
Authenticated {
access_token: SecretString,
token_type: String,
refresh_token: SecretString,
},
}Expand description
Represents the current phase of Robinhood authentication.
Transitions follow the pattern:
Unauthenticated -> (Challenged | MfaRequired | DeviceVerification) -> Authenticated.
Variants§
Unauthenticated
Indicates that no authentication attempt has been made or credentials have been cleared.
Challenged
Indicates the server issued a challenge that must be answered before authentication can proceed.
Fields
challenge_type: ChallengeTypeThe type of challenge issued (e.g., SMS or email).
MfaRequired
Indicates the server requires a multi-factor authentication code (e.g., TOTP).
DeviceVerification
Indicates the server requires device verification before proceeding.
Authenticated
Indicates successful authentication with valid OAuth tokens.
Fields
access_token: SecretStringThe OAuth access token used to authorize API requests.
refresh_token: SecretStringThe OAuth refresh token used to obtain a new access token when the current one expires.
Implementations§
Source§impl AuthState
impl AuthState
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Returns true if the state is AuthState::Authenticated.
Returns the formatted Authorization header value (e.g., "Bearer <token>"),
or None if the state is not AuthState::Authenticated.
Sourcepub fn refresh_token(&self) -> Option<&SecretString>
pub fn refresh_token(&self) -> Option<&SecretString>
Returns a reference to the OAuth refresh token, or None if the state
is not AuthState::Authenticated.