cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAPJRA container managed authentication (SSO) with different logon language

Former Member
0 Kudos
128

I have a java application which uses it's own SAP resource adapter archive. In the ra.xml the "Language" parameter is hard coded currently to "EN". What I want to do is to be able to still make use of the SSO2 ticket which is being passed along from the web container to the EJB container to the resource adapter, but simply override the logon language for this user based on their current selected java locale.

I've tried this:


ConnectionSpecFactory csf = (ConnectionSpecFactory)initialcontext.lookup(CONN_FACTORY_NAME);
            ConnectionSpec properties = csf.createConnectionSpec("300", "DE");
            connectionFactory = (ConnectionFactory) csf;
            connection = connectionFactory.getConnection(properties); 
            interaction = connection.createInteraction

But it doesn't work...

adding the hard coded username and password into the createConnectionSpec method does work, but then I loose the SSO ticket which I need to maintain.

Does anyone know how to use one resource adapter with SSO and override the SAP logon language?

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Figured this out - hopefully this will save someone some time, somewhere...


IUser sapUser = UMFactory.getAuthenticator().getLoggedInUser();            
IUserMapping umapping = UMFactory.getUserMapping();
IUserMappingData mappingData = umapping.getUserMappingData(null, sapUser);
Properties properties = new Properties();
mappingData.enrich(properties);
			
InitialContext initialcontext = new InitialContext();
connectionFactory = (ConnectionFactoryImpl) initialcontext.lookup(CONN_FACTORY_NAME);
ConnectionSpec spec = connectionFactory.createConnectionSpec(null, properties.get("jco.client.user").toString(), properties.get("jco.client.passwd").toString(), lang);
            
connection = connectionFactory.getConnection(spec);
interaction = connection.createInteraction();

Edited by: Chris Hesse on Aug 11, 2011 9:40 PM

Edited by: Chris Hesse on Aug 11, 2011 9:42 PM