cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Mapped Username / Password

Former Member
0 Kudos
189

Hi,

I'm trying to access a users mapped username/password for a custom system from my java iView but I'm not sure how.

Is there a way of accessing these data in order to create a java iView that "knows" the users mapped login-details?

Thanks!

Regards

Jonas Daugaard

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Where can I find the jar that contains the IUserMappingService?

Thanks in advance

Jonas Daugaard

detlev_beutner
Active Contributor
0 Kudos

Hi Jonas,

see or for example.

In addition, it would be great if someone could explain me why pointing to an already existing answer is worth nothing while repeating the same stuff someone just pointed to -- in my eyes just superflous -- is worth something... Strange things going on here...

Best regards

Detlev

Former Member
0 Kudos

I will award you for your help on this matter. Thank you

Former Member
0 Kudos

Hi Jonas,

To store the usermapping info you would use similar code. The following code stores usermapping info.

IUserMappingService umap = (IUserMappingService)
PortalRuntime.getRuntimeResources().getService(IUserMappingService.KEY);
IUser userid = request.getUser();
//get the mapping data for your system alias
//change the code to point it to your alias name
IUserMappingData iumd = umap.getMappingData ("hotmail", userid);
Map map = new HashMap ();
try {
	//set the user name 
	map.put("user","userid");
        //set the password
	map.put("mappedpassword","password");
        iumd.storeLogonData(map);
} catch (Exception e) {response.write(e.getMessage());}

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Jonas,

The following code will get you the info.

IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
//get usermapping service
IUserMappingService iums = (IUserMappingService) PortalRuntime.getRuntimeResources().getService(IUserMappingService.KEY);
//get the mapping data, provide your system alias
IUserMappingData iumd = iums.getMappingData("System Alias", request.getUser());
Map map = new HashMap();
 try {
    iumd.enrich(map);
} catch (Exception e) {}
//Get the userid and password for employee express
String userid = (String)map.get ("user");
String password = (String)map.get ("mappedpassword");

detlev_beutner
Active Contributor
0 Kudos

Hi Jonas,

see

Hope it helps

Detlev