class AwsCredentialConnector implements CredentialConnector {

    @Override
    public CloudCredentialStatus verify(AuthenticatedContext authenticatedContext, CredentialVerificationContext credentialVerificationContext) {
        CloudCredential credential = authenticatedContext.getCloudCredential();
        LOGGER.debug("Create credential: {}", credential);
        AwsCredentialView awsCredential = credentialViewProvider.createAwsCredentialView(credential);
        String roleArn = awsCredential.getRoleArn();
        String accessKey = awsCredential.getAccessKey();
        String secretKey = awsCredential.getSecretKey();

        CloudCredentialStatus result;
        if (isNoneEmpty(roleArn, accessKey, secretKey)) {
            String message = "Please only provide the 'role arn' or the 'access' and 'secret key'";
            result = new CloudCredentialStatus(credential, CredentialStatus.FAILED, new Exception(message), message);
        } else if (isNotEmpty(roleArn)) {
            result = verifyIamRoleIsAssumable(credential, credentialVerificationContext);
        } else if (isEmpty(accessKey) || isEmpty(secretKey)) {
            String message = "Please provide both the 'access' and 'secret key'";
            result = new CloudCredentialStatus(credential, CredentialStatus.FAILED, new Exception(message), message);
        } else {
            result = verifyAccessKeySecretKeyIsAssumable(credential);
        }
        return result;
    }

}