private Principal createPrincipal(String schema, JsonNode principalNode) {
        if (schema.equalsIgnoreCase(PRINCIPAL_SCHEMA_USER)) {
            return new Principal(PRINCIPAL_SCHEMA_USER, principalNode.asText(), options.isStripAwsPrincipalIdHyphensEnabled());
        } else if (schema.equalsIgnoreCase(PRINCIPAL_SCHEMA_SERVICE)) {
            return new Principal(schema, principalNode.asText());
        } else if (schema.equalsIgnoreCase(PRINCIPAL_SCHEMA_FEDERATED)) {
            if (WebIdentityProviders.fromString(principalNode.asText()) != null) {
                return new Principal(WebIdentityProviders.fromString(principalNode.asText()));
            } else {
                return new Principal(PRINCIPAL_SCHEMA_FEDERATED, principalNode.asText());
            }
        }
        throw new SdkClientException("Schema " + schema + " is not a valid value for the principal.");
    }
Creates a new principal instance for the given schema and the Json node.

@param schema
           the schema for the principal instance being created.
@param principalNode
           the node indicating the AWS account that is making the
           request.
@return a principal instance.
aws-java-sdk-core/src/main/java/com/amazonaws/auth/policy/internal/JsonPolicyReader.java