Class JavaCredentialsFactory


  • @ThreadSafe
    public final class JavaCredentialsFactory
    extends Object
    Turns an AWS credentials provider (which vends AWS credentials) into KinesisVideoCredentialsProvider (which vends KinesisVideoCredentials). There are two types of KinesisVideoCredentialsProvider:
    • One that provides temporary ephemeral credentials (session token)
    • And static that just provides access key + secret key (also known as long-lived credentials)
    See Also:
    JavaCredentialsProviderImpl
    • Method Detail

      • createKinesisVideoCredentialsProvider

        public static KinesisVideoCredentialsProvider createKinesisVideoCredentialsProvider​(@Nonnull
                                                                                            com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider)
        Returns the correct Kinesis Video Credentials Provider based on if the AWS Credentials provider returns a session token or not. Use this if you know your session token lasts for 1 hour.
      • createKinesisVideoCredentialsProvider

        public static KinesisVideoCredentialsProvider createKinesisVideoCredentialsProvider​(@Nonnull
                                                                                            com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider,
                                                                                            @Nonnull
                                                                                            Duration credentialsRefreshIntervalFallback)
        Parameters:
        awsCredentialsProvider - AWSCredentialsProvider
        credentialsRefreshIntervalFallback - If the AWSCredentialsProvider returns temporary credentials, how often those credentials should be refreshed. Can be less than its actual expiration. But should NOT be greater than the configured AWS expiration (e.g. role duration seconds).

        If the AWSCredentialsProvider returns non-expiring credentials (not recommended for production use), use KinesisVideoCredentials.getCredentialsNeverExpire().

        Returns:
        the correct (temporary/non-temporary) Kinesis Video Credentials Provider based on the AWS Credentials Provider
        See Also:
        Using AWS access keys to authenticate AWS SDKs and tools