Working with Credentials

To make requests to Impossible FX Services, you will need to supply authentication credentials to the FX SDK for Java. There are a number of ways to do this:

Using the Default Credential Provider Chain

When you initialize a new service client without supplying any arguments, the SDK for Java will attempt to find credentials using the default credential provider chain implemented by the DefaultCredentialsProviderChain class. The default credential provider chain looks for credentials in this order:

  1. Environment Variables – FX_APIKEY and FX_APISECRET. The SDK for Java uses the EnvironmentVariableCredentialsProvider class to load these credentials.
  2. Java System Properties – fx.apiKey and fx.secretKey. The SDK for Java uses the SystemPropertiesCredentialsProvider to load these credentials.

Explicitly Specifying Credentials

If neither the default credential chain or a specific or custom provider or provider chain works for your code, you can set credentials explicitly by supplying them yourself.

To explicitly supply credentials to a FX service client:

Instantiate a StaticCredentialsProvider with your API key and secret. For example:

fx = FXRenderClient.builder()
    .withProvider(new StaticCredentialsProvider("UZGSHGAIUZAUI", "JHjkJHJdsd7HKJ765uFHGF65456XYZ))
    .withRegion(Regions.EU_WEST_1)
    .build();    

Terms of Use | © 2017, Impossible Software, or its affiliates. All rights reserved.