DataPower

 View Only

 Gatewayscript and password alias mapping

Andreas Brand's profile image
Andreas Brand posted Tue December 09, 2025 05:12 AM

Good afternoon.


I have a working gateway script that sends a request to another server using “urlopen.HttpUserAgent.” The connection is secured with basic authentication. Unfortunately, the credentials are visible in the gateway script. This is bad because the script is managed in a GIT.


My question: I would like to connect urlopen with a “password alias mapping.” However, I have not been able to find any information on whether and how this can be done. There is a parameter called ‘agent’ in urlopen, but there is no corresponding link to “basic authentication policy.”
 
Has anyone been able to connect a “password alias mapping” to a gateway script? Or what approach would you choose to avoid having to store the password in the gateway script?


We are running Datapower IDG.10.5.0.19.

Thank you very much for your input.

Best regards, 
Res

Joseph Morgan's profile image
Joseph Morgan IBM Champion

Is it not using the User Agent configuration of the service to which the GWS action is ultimately associated?  That is, configure or customize a user agent for the service and setup the Basic Authentication policy for the url of the urlopen.   If that works, you can use the Password Alias.

P.S.  Let me know.  I'm talking off the top of my head here.

Andreas Brand's profile image
Andreas Brand

Thanks Joseph for the input.

I tried the “User Agent configuration” method. However, it seems that this only becomes active once the policy is complete.

My GWS call is part of the policy for retrieving external information and processing it further in the same policy. I had hoped that the agent option in GWS's urlopen could be used for this. But I didn't get anywhere.

In the meantime, I found the following blog by Hermanni Pernaa and am checking whether I can go down this route: “DataPower: How to use password map aliases for safekeeping.”

Best regards
Res

Andreas Brand's profile image
Andreas Brand

Hello Joseph

Good news, thanks to Hermanni Pernaa's blog post, I found my mistake: In the service configuration in the “Advanced” tab, “Process Messages Whose Body Is Empty” must be set to “on”.

Now openurl in GWS works with password alias :)

Best regards
Res