AWSClientAuthCognitoCachingAuthenticatedCredentialsProvider.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <aws/cognito-identity/CognitoIdentityClient.h>
  10. #include <aws/identity-management/auth/CognitoCachingCredentialsProvider.h>
  11. #include <aws/identity-management/auth/PersistentCognitoIdentityProvider.h>
  12. namespace AWSClientAuth
  13. {
  14. //! Cognito Caching Credentials Provider implementation that is derived from AWS Native SDK.
  15. //! For use with authenticated credentials.
  16. class AWSClientAuthCognitoCachingAuthenticatedCredentialsProvider
  17. : public Aws::Auth::CognitoCachingCredentialsProvider
  18. {
  19. public:
  20. AWSClientAuthCognitoCachingAuthenticatedCredentialsProvider(
  21. const std::shared_ptr<Aws::Auth::PersistentCognitoIdentityProvider>& identityRepository,
  22. const std::shared_ptr<Aws::CognitoIdentity::CognitoIdentityClient>& cognitoIdentityClient = nullptr);
  23. protected:
  24. Aws::CognitoIdentity::Model::GetCredentialsForIdentityOutcome GetCredentialsFromCognito() const override;
  25. };
  26. //! Cognito Caching Credentials Provider implementation that is eventually derived from AWS Native SDK.
  27. //! For use with anonymous credentials.
  28. class AWSClientAuthCachingAnonymousCredsProvider : public AWSClientAuthCognitoCachingAuthenticatedCredentialsProvider
  29. {
  30. public:
  31. AWSClientAuthCachingAnonymousCredsProvider(
  32. const std::shared_ptr<Aws::Auth::PersistentCognitoIdentityProvider>& identityRepository,
  33. const std::shared_ptr<Aws::CognitoIdentity::CognitoIdentityClient>& cognitoIdentityClient = nullptr);
  34. protected:
  35. Aws::CognitoIdentity::Model::GetCredentialsForIdentityOutcome GetCredentialsFromCognito() const override;
  36. };
  37. } // namespace AWSClientAuth