Accessing WAM IPolicyClient
Posted: Tue May 17, 2011 2:44 pm
Here is how we are currently access the WAM header info:
IPolicyClient ssoClient = WebApplicationPolicyClient.getPolicyClient();
long acctId = Long.parseLong(ssoClient.getPolicyAttribute(PolicyHeader.LDS_ACCT_ID));
user.setLdsAccountId(acctId);
user.setLdsEmailAddr(ssoClient.getPolicyAttribute(PolicyHeader.EMAIL));
user.setLdsPreferredLang(ssoClient.getPolicyAttribute(PolicyHeader.PREFERRED_LANGUAGE));
user.setLdsPreferredNm(ssoClient.getPolicyAttribute(PolicyHeader.PREFERRED_NAME));
....
When we first started with WAM, this was how they instructed us to get the data. Now that WAM has been integrated into the stack, is this still the prescribed way?
This way is working great, until someone internationally logs into our MTM client. Someone like:
Angel AnĂbal Cepeda Chicaiza
When we print the WAM data from our logs, the account name is UTF8 encoded:
2011-05-17 12:49:54,765 [FTX15090750] [INFO ] getUser() - LDS Account User Details: User Info: ldsAccountNm:angeluzelyte ldsPreferredNm:=?UTF-8?B?QW5nZWwgQW7DrWJhbCBDZXBlZGEgQ2hpY
2FpemE=?= ldsUnits:/7u176524/5u512028/ ldsAccountId:3512317026385640 ldsPreferredLang:es ldsEmailAddr:elyte_ingenieria@hotmail.com parentUnitNbr:512028 childUnitNbr:176524
It appear that this is a WAM issue, but it may be that our app needs to do something different. (see screen shot)
IPolicyClient ssoClient = WebApplicationPolicyClient.getPolicyClient();
long acctId = Long.parseLong(ssoClient.getPolicyAttribute(PolicyHeader.LDS_ACCT_ID));
user.setLdsAccountId(acctId);
user.setLdsEmailAddr(ssoClient.getPolicyAttribute(PolicyHeader.EMAIL));
user.setLdsPreferredLang(ssoClient.getPolicyAttribute(PolicyHeader.PREFERRED_LANGUAGE));
user.setLdsPreferredNm(ssoClient.getPolicyAttribute(PolicyHeader.PREFERRED_NAME));
....
When we first started with WAM, this was how they instructed us to get the data. Now that WAM has been integrated into the stack, is this still the prescribed way?
This way is working great, until someone internationally logs into our MTM client. Someone like:
Angel AnĂbal Cepeda Chicaiza
When we print the WAM data from our logs, the account name is UTF8 encoded:
2011-05-17 12:49:54,765 [FTX15090750] [INFO ] getUser() - LDS Account User Details: User Info: ldsAccountNm:angeluzelyte ldsPreferredNm:=?UTF-8?B?QW5nZWwgQW7DrWJhbCBDZXBlZGEgQ2hpY
2FpemE=?= ldsUnits:/7u176524/5u512028/ ldsAccountId:3512317026385640 ldsPreferredLang:es ldsEmailAddr:elyte_ingenieria@hotmail.com parentUnitNbr:512028 childUnitNbr:176524
It appear that this is a WAM issue, but it may be that our app needs to do something different. (see screen shot)