cancel
Showing results for 
Search instead for 
Did you mean: 

How to read validto attribute from UME

Former Member
0 Kudos

Hi, I'm looking for a way to manage validto attribute form UME.

In this moment I'm able to obtain a IUser by the following code:

public String[] ReadUmeGroup(String anUser) {

Vector aResult = new Vector();

String[] array_result = null;

String aGroup = "";

IUser user = null;

try {

IUserFactory userFactory = UMFactory.getUserFactory();

IUserSearchFilter userSearchFilter = userFactory.getUserSearchFilter();

userSearchFilter.setUniqueName(anUser,ISearchAttribute.LIKE_OPERATOR,false);

ISearchResult searchResult = userFactory.searchUsers(userSearchFilter);

while (searchResult.hasNext()) {

user = userFactory.getUser(searchResult.next().toString());

if (user!=null) {

try { ....

How to obtain the validto information ?

How to use validto like search filter parameter ?

Thanks in advance for your colaboration.

Best regards

Gianfranco

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi, we're changed the date (31/12/2500 --> 31/12/2007) but the result is always null.

Any other idea ?

Thanks

Gianfranco

Former Member
0 Kudos

Hi, thanks for your answer.

I created this method

private String getValidToDate(String user) throws UMException {

String validToDate = null;

try {

IUserAccountFactory accFact = UMFactory.getUserAccountFactory();

IUserAccount userAcc = accFact.getUserAccount(user);

validToDate = userAcc.getValidToDate().toString();

}

catch (Exception e) {}

return validToDate;

}

and I obtained null value as with my method:

private String getValidToAttribute(IUser user) {

String[] validTo = null;

String[] namespace = null;

String aResult;

try {

namespace = user.getAttributeNamespaces();

if (namespace != null) {

validTo = user.getAttribute(namespace[0],"validto");

}

else {

aResult = "namespace = null";

}

}

catch (Exception e) {

}

if (validTo != null) {

aResult = validTo[0];

}

else {

aResult = "validTo = null " + "namespace[0] = " + namespace[0];

}

return aResult;

};

But in the UserManagement there is 31/12/2500.

kishorg
Advisor
Advisor
0 Kudos

Hi Gianfranco Bello ,

it is the default valid to date . during user creation , u have the option to set valid to date for the user.

in visual administrator , u can change 31/12/2500 , to particular valid to date.

Regarads

Kishor Gopinathan

Edited

-


HI ,

have u created new users through Visual Admin ?.

just try to create new users and assign ur own valid to date.

just try ....

Message was edited by: Kishor Gopinathan

kishorg
Advisor
Advisor
0 Kudos

Hi ,

IUserAccountFactory accFact = UMFactory.getUserAccountFactory();

IUserAccount userAcc = accFact.getUserAccount(<user id>);

Regards

Kishor Gopinathan

here from this userAcc , u will get the validto date ,,

then use your own logic to validate use..

kishorg
Advisor
Advisor
0 Kudos

Hi Gianfranco Bello ,

u can use the com.sap.security.api

Interface IUserAccount to get the user account details .

from this ,, u will get valid to date..

getValidToDate()

IUserAccount -- details.

-


http://media.sdn.sap.com/html/submitted_docs/60_sp2_javadocs/ume/com/sap/security/api/IUserAccount.h...

Regards

Kishor Gopinathan