pub struct OAuthCredential { /* private fields */ }Expand description
Wraps the OAuth credential payload returned by popup/redirect handlers.
The credential format mirrors the JS SDK: the handler supplies a JSON blob
describing the provider response (ID token, access token, pending post body).
OAuthCredential exposes helpers to build the postBody required by the
signInWithIdp REST endpoint.
Implementations§
Source§impl OAuthCredential
impl OAuthCredential
pub fn new( provider_id: impl Into<String>, sign_in_method: impl Into<String>, token_response: Value, ) -> Self
pub fn with_raw_nonce(self, nonce: Option<String>) -> Self
pub fn provider_id(&self) -> &str
pub fn sign_in_method(&self) -> &str
pub fn token_response(&self) -> &Value
pub fn raw_nonce(&self) -> Option<&String>
Sourcepub fn to_json_string(&self) -> AuthResult<String>
pub fn to_json_string(&self) -> AuthResult<String>
Serializes the credential to a JSON string.
Sourcepub fn from_json(value: Value) -> AuthResult<Self>
pub fn from_json(value: Value) -> AuthResult<Self>
Reconstructs a credential from a JSON value previously produced via [to_json].
Sourcepub fn from_json_str(data: &str) -> AuthResult<Self>
pub fn from_json_str(data: &str) -> AuthResult<Self>
Reconstructs a credential from a JSON string representation.
Sourcepub fn build_post_body(&self) -> AuthResult<String>
pub fn build_post_body(&self) -> AuthResult<String>
Builds the postBody query string expected by signInWithIdp.
Trait Implementations§
Source§impl Clone for OAuthCredential
impl Clone for OAuthCredential
Source§fn clone(&self) -> OAuthCredential
fn clone(&self) -> OAuthCredential
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OAuthCredential
impl Debug for OAuthCredential
Source§impl From<OAuthCredential> for AuthCredential
impl From<OAuthCredential> for AuthCredential
Source§fn from(value: OAuthCredential) -> Self
fn from(value: OAuthCredential) -> Self
Converts to this type from the input type.
Source§impl TryFrom<AuthCredential> for OAuthCredential
impl TryFrom<AuthCredential> for OAuthCredential
Auto Trait Implementations§
impl Freeze for OAuthCredential
impl RefUnwindSafe for OAuthCredential
impl Send for OAuthCredential
impl Sync for OAuthCredential
impl Unpin for OAuthCredential
impl UnwindSafe for OAuthCredential
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