Click or drag to resize

MembershipProvidersServicesCreateUser Method


Creates a new User account in Ingeniux CMS. In Membership Provider is integrated account provider (Ingeniux Membership Provider or SQL provider), allow to set password using the provider.

Also, it will try to send 2 email out to the new user's email address, first to inform user that the account has been created, second to send user the password of the new account.

If for any reason the email cannot be sent out, the password information will be brought back to client, so the Administrator can manually inform new user the password.

Namespace:  IngeniuxCMService
Assembly:  IngeniuxCMService (in IngeniuxCMService.dll) Version: 10.3.169
Syntax
public XHRServiceResponseGeneric<CreateUserOutput> CreateUser(
	string providerName,
	string username,
	string password,
	string email
)

Parameters

providerName
Type: SystemString

Name of the membership provider. It is the value of "name" attribute in for the provide entry local-membership.config

Examples
XML
<add name="IGXADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, version=4.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    connectionStringName="IGXADConnectionString"
    attributeMapUsername="sAMAccountName"/>
username
Type: SystemString
User Account Name (Id)
password
Type: SystemString
Password for user account to set by Membership Provider. Only needed for Integrated providers
email
Type: SystemString
Email address of the new User

Return Value

Type: XHRServiceResponseGenericCreateUserOutput

The status information on user creation.

Examples
Sample JSON return - Email successful. Note that the "Newpassword" field is null, and no email errors
JavaScript
{
    "code": 0,
    "error": null,
    "message": {
        "EmailError": null,
        "EmailError2": null,
        "EmailSent": true,
        "MinNonAlphaNumericCharactersLength": 2,
        "MinPasswordLength": 8,
        "NewUser": "TestUser",
        "Newpassword": null,
        "Status": "Success",
        "StatusDetail": ""
    }
}
Examples
Sample JSON return - Email not successful, either due to invalid System Options > Email settings, or problem reaching target domain. We will receive email errors, and the password. Therefore, to make sure the password is not exposed, make sure to configure Email settings correctly, and make sure the User's email address is correct.
JavaScript
{
    "code": 0,
    "error": null,
    "message": {
        "EmailError": "The parameter 'from' cannot be an empty string.\u000d\u000aParameter name: from",
        "EmailError2": "The parameter 'from' cannot be an empty string.\u000d\u000aParameter name: from",
        "EmailSent": false,
        "MinNonAlphaNumericCharactersLength": 2,
        "MinPasswordLength": 8,
        "NewUser": "TestUser",
        "Newpassword": "letmein",
        "Status": "Success",
        "StatusDetail": ""
    }
}
Remarks

This operation is to be used with integrated providers only. It is used to create authentication account, not used to create Ingeniux CMS users.

See Also