Organization Factory

The Organization factory is built with Organization credentials and has access to the Organization Client, Directory Client, and the Service Client.

Creating an Organization Factory

An Organization factory can be created by using the Factory factory. It utilizes Organization specific credentials to identify itself, encrypt and sign the request data, and verify the signature and decrypt encrypted response data. All of the information can be located on the Keys tab of the Organization’s page in Admin Center.

The data is as follows:

  • Organization ID
  • Private Key


var privateKey = File.ReadAllText("organization_private_key.pem'");
var organizationId = "9e0310ba-d9d6-11e6-942a-b4750ee43a10";
var organizationFactory = factoryFactory.MakeOrganizationFactory(organizationId, privateKey);
File file = new File("organization_private_key.pem");
Scanner sc = new Scanner(privateKeyFile);
StringBuilder sb = new StringBuilder();
while (sc.hasNextLine()) {
String privateKey = sb.toString();
String organizationId = "9e0310ba-d9d6-11e6-942a-b4750ee43a10";
OrganizationFactory organizationFactory = factoryFactory.makeOrganizationFactory(organizationId, privateKey);
# Python does not have a FactoryFactory or FactoryFactoryBuilder
with open('organization_private_key.pem') as pem:
    private_key =
organization_id = "9ecc57e0-fb0f-4971-ba12-399b630158b0"
organization_factory = OrganizationFactory(organization_id, private_key)

Making An Organization Client

The Organization Client can be made without credentials as they are already provided to the factory:

var organizationClient = organizationFactory.MakeOrganizationClient();
OrganizationClient organizationClient = organizationFactory.makeOrganizationClient();
organization_client = organization_factory.make_organization_client()

Making A Directory Client

The Directory Client can be made by providing a Directory ID for a Directory belonging to the Organization as follows:

var directoryId = "f10d644a-b392-42e5-aaba-e722838adf67";
var directoryClient = organizationFactory.MakeDirectoryClient(directoryId);
String directoryId = "f10d644a-b392-42e5-aaba-e722838adf67";
DirectoryClient directoryClient = organizationFactory.makeDirectoryClient(directoryId);
directory_id = "f10d644a-b392-42e5-aaba-e722838adf67"
directory_client = organization_factory.make_directory_client(directory_id)

Making A Service Client

The Service Client can be accessed by providing a Service ID for a Service belonging to the Organization or one of its Directories as follows:

var serviceId = "b1d05c28-0b18-41e4-94a0-853758eeefc8";
var serviceClient = organizationFactory.MakeServiceClient(serviceId);
String serviceId = "b1d05c28-0b18-41e4-94a0-853758eeefc8";
ServiceClient serviceClient = organizationFactory.makeServiceClient(serviceId);
service_id = "b1d05c28-0b18-41e4-94a0-853758eeefc8"
service_client = organization_factory.make_service_client(service_id)

User Contributed

LaunchKey links to user contributed code as a resource to its community. LaunchKey does not in any way guarantee or warrant the quality and security of these code bases. User contributed code is supported by the creators. If you do find a link from the site to user contributed code that is malicious or inappropriate in any way, please report that link to LaunchKey immediately and we will investigate the claim. Submit any issue to LaunchKey support at ×