Altova MapForce 2024 Enterprise Edition

Dynamic authentication is the ability to supply the username and password to the mapping at runtime, as input parameters. Dynamic authentication is supported for mappings that call Web services where basic HTTP authentication is necessary.

To set up dynamic authentication:

1.Open a mapping that contains a Web service call, or add a Web service to a new mapping. For details, see Adding a Web Service Call (REST-Style) and Adding a Web Service Call (SOAP).

2.Double-click the title bar of the Web service component to open the Settings dialog box.

3.Next to "HTTP Security Settings", click Edit.

4.Select Dynamic Authentication.

5.Click OK.

 

Once dynamic authentication is enabled, the "Request" side of the Web service component gets two new input connectors: HTTP username and HTTP Password. To supply the actual values, add two new input components to the mapping, using the Insert | Insert Input menu command, and connect them to the HTTP Username and HTTP Password, respectively.

mf_dynamic_auth_01

To preview the mapping in MapForce, you can optionally supply the username and password as "design-execution" values. To do this, double-click the title bar of each input component, and enter the username and password, respectively, in the Value text box. For more information, see Supplying Parameters to the Mapping.

 

Username and password are treated just like any other design-time execution values, so they are saved in the mapping design file as clear text. To circumvent this, do not enter any design-time execution values at all, or use the Credentials approach.

 

Dynamic authentication in MapForce Server

If you configured the mapping for dynamic authentication, then the respective username and password must be supplied as parameters at mapping runtime. This is not different from supplying any other parameter kinds to the mapping. For example, when calling MapForce Server at the command line, the syntax for a mapping like the one above is:

 

<exec> run mapping.mfx --p=username:admin --p=password:dj9JaVax

 

Where:

 

<exec> is the path to the MapForce Server executable. This path can be either absolute or, if the current directory is the same as the executable, you can enter just the executable name.

username and password are the names of the respective input parameters on the MapForce mapping.

 

When calling the MapForce Server API, you can authenticate the mapping by calling the AddParameter method before calling the Run method. For example, in C#, the code to achieve this could look as follows:

 

try
{
  Altova.MapForceServer.Server mfs = new Altova.MapForceServer.Server();
  mfs.AddParameter("username", "admin");
  mfs.AddParameter("password", "dj9JaVax");
  mfs.WorkingDirectory = "C:\\Work";
  if(mfs.Run("C:\\Work\\mapping.mfx"))
  {
    Console.WriteLine("Success");
  }
  else
  {
    Console.WriteLine(mfs.LastExecutionMessage);
  }
  Console.ReadLine();
}
catch(Exception ex)
{
Console.WriteLine(ex);
}

 

Again, the username and password (first argument to the AddParameter method) must be the same as the names of the respective input parameters on the MapForce mapping.

 

Dynamic authentication in FlowForce Server

When you deploy a mapping containing dynamic authentication to FlowForce Server, the username and password become input parameters to the mapping function. Any FlowForce Server job that calls such a mapping function will require the username and password before it can run successfully, for example:

inc-dynamic-auth-flowforce

In the example illustrated above, the username and password are simply entered in the respective text boxes. However, you can also supply them as input parameters to the job. For more information, refer to FlowForce Server documentation (https://www.altova.com/documentation).

 

© 2017-2023 Altova GmbH