IBM Verify

IBM Verify

Join this online user group to communicate across Security product users and IBM experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Creating a new mechanism

    Posted Thu April 29, 2021 05:16 PM
    I need to create a new mechanism. But I would like to add custom properties to the mechanism.
    If we add a mechanism of type "Email Message", it comes with a few properties, like "Email Attribute Identifier", "Email Sender Value", and so on.

    Now I want to create a new mechanism to send soap requests, and need to configure some properties to the mechanism.
    How do I do it?

    ------------------------------
    Joao Goncalves
    Pyxis, Lda.
    Sintra
    +351 91 721 4994
    ------------------------------


  • 2.  RE: Creating a new mechanism

    Posted Thu April 29, 2021 05:24 PM
    Hi Joao

    I assume you are creating you new Authentication Mechanism as an InfoMap ? Please confirm. For an InfoMap, there is not much such that we can configure in the mechanism.

    The approach I have taken for externalising in such case "per environment" or even global variables" is to define all variables in an external myinfomap-definition.js file, and import it at runtime as follow:

    "importMappingRule("myinfomap-definition");"


    It will contain whatever I need to refer to in the InfoMap JS file such as:

    var var1="123456";
    var var2="67890";
    ...

    You will need of course to import that myinfomap-definition.js file into your appliance.

    Hope this helps.

    ------------------------------
    Sylvain Gilbert
    ------------------------------



  • 3.  RE: Creating a new mechanism

    Posted Fri April 30, 2021 04:51 AM
    Edited by Joao Goncalves Fri April 30, 2021 05:07 AM
    That is the only mechanism I can see that might solve the problem. If I could create my own Mechanism Type, I think it would be the best way!

    The solution you mention is a possible approach, it would be better if I could create "CustomInfoMap" mechanism type where the variable names would be fixed, and I would just define their variables!

    In which directory do you place this file so that ImportMapRule can find it?

    I'll let you know if I come up with an alternative solution.

    Thanks

    ------------------------------
    Joao Goncalves
    Pyxis, Lda.
    ------------------------------



  • 4.  RE: Creating a new mechanism

    Posted Fri April 30, 2021 10:07 AM
    Another way I've used to store connection properties is to create a new Server Connection, then in your infomap you can use com.ibm.security.access.server_connections.ServerConnectionFactory to get the connection and the properties associated with that connection.  Of course, you're limited to the properties that are available for the specific type of connection you use, but at least is something and what I like is that if there is a password involved at least you can't see it in clear text.

    ------------------------------
    Enio Padilla
    ------------------------------



  • 5.  RE: Creating a new mechanism

    Posted Fri April 30, 2021 12:10 PM
    Edited by Joao Goncalves Fri April 30, 2021 12:25 PM
    I suppose you use the Web Service Connection.
    I am not sure about WebService Connections, if it supports sending REST or SOAP, or both.
    After you get a connectionFactory, you can then set the URL, headers and body you want, I suppose!
    I'll have too look at the javascript library documentation. But this something I will look into.

    Thanks

    ------------------------------
    Joao Goncalves
    Pyxis, Lda.
    ------------------------------



  • 6.  RE: Creating a new mechanism

    Posted Fri April 30, 2021 12:26 PM
    In my case I used a web server connection, but you can also use an LDAP or SMTP connection.  I only used the web server connection as a placeholder for the properties, not to perform the actual connection.  Here is some code to get those properties in an infomap:

    importPackage(Packages.com.ibm.security.access.server_connections);

    var connName = "MyWebServerConnection";

    var myConn = ServerConnectionFactory().getWebConnectionByName(connName);
    if (myConn != null) {
    var myURL = myConn.getUrl();
    var myPasswdToken = myConn.getPasswd();
    var myTruststore = myConn.getKeystore();


    ------------------------------
    Enio Padilla
    ------------------------------