The Directory factory is built with Directory credentials and has access to both the Directory Client
and the Service Client.
Creating a Directory Factory
A Directory factory can be created by using the DirectoryFactory class. It utilizes Directory 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 Directory's page in Admin Center. The data is as follows:
from launchkey.factories import DirectoryFactory
directory_id = "9e0310ba-d9d6-11e6-942a-b4750ee43a10";
private_key = "-----BEGIN RSA PRIVATE KEY-----\n" \
"-----END RSA PRIVATE KEY-----\n"
directory_factory = DirectoryFactory(directory_id, private_key);
Accessing The Directory Client
The Directory Client can be accessed without credentials as they have already been provided to the factory:
directory_client = directory_factory.make_directory_client()
Accessing the Service Client
The Service Client can be access by providing a Service ID for a Service belonging to the Directory as follows:
service_id = "b1d05c28-0b18-41e4-94a0-853758eeefc8";
service_client = directory_factory.make_service_client(service_id)
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 https://launchkey.com./support.