Programmatic login to MWS

I java a small JSP webapp which I am deploying in the MWS (Jetty) server.

What I am trying to do is associate the java session with an MWS portal session. ie. programmatically login to the portal system and re-direct to my portlet app.

I was wondering if there was a way to do this correctly. I’ve experimented with the following:

IContext context = com.webMethods.portal.bizPolicy.impl.ContextFactory.acquireContext(request);
IBizPolicyManager bpm = (IBizPolicyManager) PortalSystem.getBizPolicyProvider();
IDirSystemBizPolicy dirSystemPolicy = (IDirSystemBizPolicy) bpm.getBizPolicy(IBizPolicyNames.DIRECTORY_SYSTEM);
IDirUser user = dirSystemPolicy.authenticateUser(context, username, password);

…which tests authentication, however for some reason it causes havoc with other session in the portal app (weird!).

Any suggestions/direction greatly appreciated.

Cheers.

You need to create a startup page rule, follow [url]http://techcommunity.softwareag.com/ecosystem/documentation/webmethods/wmsuite8_ga/My_webMethods_and_Task_Engine/8-0-SP1_Administering_My_webMethods_Server.pdf[/url] on page 248.

The Manage Start Page Rules page allows system administrators to define rules that
dictate what start page should be used. The start page is the page to which the server
redirects users after log in. Start page rules can be defined to dynamically set the default
start page for a given for a given user, group, or role.

If you use other version get the MWS admin guide for your particular version and follow on that.

Good luck