Stormpath can use namekey .
How to create an Organization
var bankOfAOrg = client.Instantiate<IOrganization>() .SetName("Bank of A") .SetNameKey("bank-of-a") .SetStatus(OrganizationStatus.Enabled);
Adding account storage to an organization:
// With a reference to an IDirectory: var newMapping = await bankOfAOrg.AddAccountStoreAsync(existingDirectory); // Or simply by href: newMapping = await bankOfAOrg.AddAccountStoreAsync("directory_href");
In order to be able to add Groups and Accounts to the Organization in the manner described above, we also need to make sure that we have marked this account repository as our default value for both accounts and groups:
newMapping.SetDefaultAccountStore(true) .SetDefaultGroupStore(true); await newMapping.SaveAsync();
Adding an account to the organization:
var chewie = client.Instantiate<IAccount>() .SetGivenName("Chewbacca") .SetSurname("the Wookiee") .SetUsername("rrwwgggh") .SetEmail(" chewie@kashyyyk.rim ") .SetPassword("Changeme123!"); chewie.CustomData.Put("favoriteShip", "Millennium Falcon"); await bankOfAOrg.CreateAccountAsync(chewie);
See here for more information.
Yaser source share