@Override
    public AWSCredentialsProvider getAssumeRoleCredentialsProvider(RoleInfo targetRoleInfo) {
        if (targetRoleInfo.getWebIdentityTokenFilePath() == null) {
            return new STSAssumeRoleSessionCredentialsProvider.Builder(targetRoleInfo.getRoleArn(), targetRoleInfo.getRoleSessionName())
                    .withLongLivedCredentialsProvider(targetRoleInfo.getLongLivedCredentialsProvider())
                    .withExternalId(targetRoleInfo.getExternalId())
                    .build();
        } else {
            return new STSAssumeRoleWithWebIdentitySessionCredentialsProvider.Builder(
                    targetRoleInfo.getRoleArn(),
                    targetRoleInfo.getRoleSessionName(),
                    targetRoleInfo.getWebIdentityTokenFilePath())
                    .build();
        }
    }
Loaded via reflection by the aws-java-sdk-core module when role assumption is configured in a
credentials profile.
aws-java-sdk-sts/src/main/java/com/amazonaws/services/securitytoken/internal/STSProfileCredentialsService.java