Click or drag to resize
CloudIdentityProviderAddUser Method
Adds a user to the account.

Namespace: net.openstack.Providers.Rackspace
Assembly: openstacknet (in openstacknet.dll) Version: 1.7.7+Branch.master.Sha.25d803f397c8693c2c13777ef6675f796f520f2c
Syntax
public virtual NewUser AddUser(
	NewUser user,
	CloudIdentity identity
)

Parameters

user
Type: net.openstack.Core.DomainNewUser
A NewUser object containing the details of the user to create.
identity
Type: net.openstack.Core.DomainCloudIdentity
The cloud identity to use for this request. If not specified, the DefaultIdentity for the current provider instance will be used.

Return Value

Type: NewUser
A NewUser object containing the details of the created user.

Implements

IIdentityProviderAddUser(NewUser, CloudIdentity)
Exceptions
ExceptionCondition
ArgumentNullExceptionIf user is .
ArgumentExceptionIf user.Username is or empty.
NotSupportedException If the provider does not support the OS-KSADM Admin Extension.

-or-

If the provider does not support the given identity type.

InvalidOperationException If user.Id is not (i.e. user represents a user that already exists).

-or-

If identity is and no default identity is available for the provider.

ServiceConflictExceptionIf a user with the specified Username already exists.
ResponseExceptionIf the REST API request failed.
Remarks
The returned NewUser object will contain the password of the created user. If no Password is specified in user, the returned password will be an automatically generated password from the server.
Caution note Caution
After this call, there is no way to retrieve the password for a user. If the password was auto-generated by the server, make sure to either store the returned value or provide the information to the user for later use.
Examples

The following example demonstrates the use of this method using the CloudIdentityProvider implementation of IIdentityProvider. For more information about creating the provider, see CloudIdentityProvider(CloudIdentity).

NewUser user = new NewUser("{username}", "{email}", enabled: true);
user = provider.AddUser(user, null);
string password = user.Password;
Version Information

.NET Framework

Supported in: 4.5

openstack.net

Supported in: 1.6, 1.5, 1.4, 1.3.6
See Also