pub struct CognitoIdentityCredentialProvider { /* private fields */ }Expand description
Cognito Identity Credentials Provider
This provider fetches temporary AWS credentials using Amazon Cognito Identity. It’s typically used for mobile and web applications that need temporary AWS access.
§Requirements
- A Cognito Identity Pool ID
- Optional: Identity token from a supported identity provider (Facebook, Google, etc.)
§Environment Variables
The provider supports the following environment variables:
AWS_COGNITO_IDENTITY_POOL_ID: The Cognito Identity Pool IDAWS_COGNITO_IDENTITY_ID: A specific identity ID (if already known)AWS_REGIONorAWS_DEFAULT_REGION: The AWS regionAWS_COGNITO_ENDPOINT: Custom endpoint (for testing)
§Usage
use reqsign_aws_core::CognitoIdentityCredentialProvider;
let provider = CognitoIdentityCredentialProvider::new()
.with_identity_pool_id("us-east-1:12345678-1234-1234-1234-123456789012")
.with_region("us-east-1");Implementations§
Source§impl CognitoIdentityCredentialProvider
impl CognitoIdentityCredentialProvider
Sourcepub fn with_identity_pool_id(self, pool_id: impl Into<String>) -> Self
pub fn with_identity_pool_id(self, pool_id: impl Into<String>) -> Self
Set the Cognito Identity Pool ID
Sourcepub fn with_region(self, region: impl Into<String>) -> Self
pub fn with_region(self, region: impl Into<String>) -> Self
Set the AWS region
Sourcepub fn with_identity_id(self, identity_id: impl Into<String>) -> Self
pub fn with_identity_id(self, identity_id: impl Into<String>) -> Self
Set a specific identity ID (if already known)
Sourcepub fn with_logins(self, logins: HashMap<String, String>) -> Self
pub fn with_logins(self, logins: HashMap<String, String>) -> Self
Add login tokens from identity providers
Trait Implementations§
Source§impl Clone for CognitoIdentityCredentialProvider
impl Clone for CognitoIdentityCredentialProvider
Source§fn clone(&self) -> CognitoIdentityCredentialProvider
fn clone(&self) -> CognitoIdentityCredentialProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ProvideCredential for CognitoIdentityCredentialProvider
impl ProvideCredential for CognitoIdentityCredentialProvider
Source§type Credential = Credential
type Credential = Credential
Credential returned by this loader. Read more
Source§async fn provide_credential(
&self,
ctx: &Context,
) -> Result<Option<Self::Credential>>
async fn provide_credential( &self, ctx: &Context, ) -> Result<Option<Self::Credential>>
Load signing credential from current env.
Auto Trait Implementations§
impl Freeze for CognitoIdentityCredentialProvider
impl RefUnwindSafe for CognitoIdentityCredentialProvider
impl Send for CognitoIdentityCredentialProvider
impl Sync for CognitoIdentityCredentialProvider
impl Unpin for CognitoIdentityCredentialProvider
impl UnsafeUnpin for CognitoIdentityCredentialProvider
impl UnwindSafe for CognitoIdentityCredentialProvider
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<T> ProvideCredentialDyn for Twhere
T: ProvideCredential + ?Sized,
impl<T> ProvideCredentialDyn for Twhere
T: ProvideCredential + ?Sized,
Source§type Credential = <T as ProvideCredential>::Credential
type Credential = <T as ProvideCredential>::Credential
Credential returned by this loader.
Source§fn provide_credential_dyn<'a>(
&'a self,
ctx: &'a Context,
) -> Pin<Box<dyn Future<Output = Result<Option<<T as ProvideCredentialDyn>::Credential>, Error>> + Send + 'a>>
fn provide_credential_dyn<'a>( &'a self, ctx: &'a Context, ) -> Pin<Box<dyn Future<Output = Result<Option<<T as ProvideCredentialDyn>::Credential>, Error>> + Send + 'a>>
Dyn version of
ProvideCredential::provide_credential.