cancel
Showing results for 
Search instead for 
Did you mean: 

Using BO SDK creation of User with Password

Former Member
0 Kudos

Hello All,

I am creating web application in which I am passing User name

and password.

In case of password it give some BO specific error like.

1) password should be 6 character.

2) password must contain number and alphanumeric value.

it is application using BO SDK.

it is possible that I can create User in BO with any password(BO SDK)

or I want to enter according to BO validation?

Please help me.

Regards,

Prashant Joshi

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

OK, that makes sense - I think I can fight my way thru the various aliases for these cats.

Thanks a LOT for taking the time to answer this.

Brent

Former Member
0 Kudos

Hi Ted,

Now I'm more confused - I think my question is if I can change a password, can I also reset a user that's marked as "Disabled" with the same method.

Walking thru the class libraries, I don't see this, and I have not found how BO does it in the CMC yet.

Any suggestions?

Thanks,

Brent

ted_ueda
Employee
Employee
0 Kudos

Did you look at the doc for IUserAlias?

Get the Aliases from IUser, and enable each.

Here's the reasoning for the design:

An User can have multiple authentication entries - possible are secEnterprise, secWinAD, secLDAP and secWindowsNT.

The different types are encapsulated using IUserAlias - so you get the collection of all aliases associated with the user using IUser.getAliases().

To allow for enabling/disabling each authentication for a user, you enable/disable each IUserAlias.

So you won't have enable/disable property for the IUser, but for the IUserAlias.

Note that a "Password" for the IUser is not associated with an IUserAlias, but only for IUser. This is because only one - the secEnterprise - allows you to change passwords via the SDK. All other authentication types have control over user passwords via the 3rd party authentication plugin.

Sincerely,

Ted Ueda

Former Member
0 Kudos

I'm trying to use this to reset user accounts, but it does not reset a disabled user - is that possibe?

I tried this, but the method is not valid - am I missing something?

((IUser)iUser).setNewPassword ("password#1"); // WORKS

((IUser)iUser).setDisabled(false); // FAILS

Thanks,

Brent

ted_ueda
Employee
Employee
0 Kudos

You enable/disable a [IUserAlias|http://devlibrary.businessobjects.com/BusinessObjectsXIR2SP2/en/en/BOE_SDK/boesdk_java_api_doc/doc/boesdk_java_apiRef/com/crystaldecisions/sdk/plugin/desktop/user/IUserAlias.html] for an IUser, and not the IUser itself.

Sincerely,

Ted Ueda

ted_ueda
Employee
Employee
0 Kudos

Default configuration of Enterprise authentication is to reject passwords that are too simple - too short or not having both alpha and numeric characters.

You can configure Enterprise authentication on the CMC to disable this check.

Sincerely,

Ted Ueda

Former Member
0 Kudos

You need to refer to BO Validation

Here is a snippet code

void addUserAndProperties(IInfoStore infoStore, String accountName, String userName, String description, boolean namedUser, boolean passwordNeverExpires, boolean mustChangePassword, boolean cannotChangePassword, String password)
    {

    try{

    // Call the addUser method to create the new user account.
    int newUserID = addUser (infoStore, accountName, userName, description);

    // Retrieve the specified user object.
	IInfoObjects rUser = infoStore.query("Select SI_ID, SI_PROGID From "
                       + "CI_SYSTEMOBJECTS Where SI_ID=" + newUserID);
	if (rUser.size() == 0)
	    {
	    //The query returned a blank collection (no object found).
        throw new Error("The user could not be found.");
		}
	IInfoObject iUser = (IInfoObject) rUser.get(0);

    // Check that the InfoObject has the User ProgID.
    String uProgID = (String) iUser.properties()
                     .getProperty(CePropertyID.SI_PROGID).getValue();
    if (uProgID.equals(CeProgID.USER))
        {
        // Set the user object's plugin-specific properties.
        ((IUser)iUser).setFullName (userName);
        ((IUser)iUser).setPasswordExpiryAllowed (passwordNeverExpires);
        ((IUser)iUser).setPasswordToChangeAtNextLogon (mustChangePassword);
        ((IUser)iUser).setPasswordChangeAllowed (cannotChangePassword);
        ((IUser)iUser).setNewPassword (password);
        //((IUser)iUser).setDescription(((IUser)iUser).getFullName());

        if (namedUser)
            {
            ((IUser)iUser).setConnection(0);
            }
        else
            {
            ((IUser)iUser).setConnection(1);
            }

        infoStore.commit (rUser);
        }
    }catch (SDKException e) {
          System.err.println("Failed to add the user's properties. Exception caught: " + e.getMessage());
    }
    }

Cheers