Use current user credentials to invoke WS

From a task view I have to invoke a WS on the IS. how can I use the credentials of the logged in MWS user to make the WS call?

Thanks in advance.

This isn’t a recommended approach. Passing usernames and passwords is not secure unless you have an SSL connection to IS. (Not all deployments of MWS will even have the password. This would be the situation if you were using NTLM, or other Authentication schemes).

If you absolutely must pass the user’s password, and your deployment is configured that you have the password, then you can use the IContext (custom MWS API) to obtain the current user’s password.

Please refer to the javadocs on IContext and IPrincipalData.


Use hybrid authentication:

To configure the MWS Single Sign-On Resource setting:
1 In Integration Server, go to Settings > Resources.
2 Under Single Sign On with My webMethods Server, ensure that the following value is entered for the MWS SAML Resolver URL setting:

On the web service connector, set the authentication method to 3 - Hybrid.

The MWS user credentials will now be used to execute the WS.

Hybrid Authentication embeds a SAML token in the HTTP AUTH header using a special user name of samlArt.
This special user name enables the Integration Server to recognise the SAML token and verify it with the My webMethods Server when they are configured to used the same user database. Setting the web service connector’s Authentication Type property to 3 (Hybrid) passes the SAML token for the front-end user for authentication. No other configuration is required – no need to set any authentication parameters except authentication type.

The IS must be configured for Central Authentication and to resolve SAML tokens against MWS. See the IS admin guide section “Accessing Integration Server Data through My webMethods” for how to configure the SAML resolver.