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.  How HTML page can get the user id from ISAM session

    Posted Wed October 30, 2019 02:14 PM
    Hi, I developed an Authentication policy in the ISAM AAC to get called by an API call, The data it receives as input ia a username and it returns the user groups and some html links. I'm coding an html page hosted by the Reverse Proxy , it can use javascript to call the API but the problem is how HTML page can get the user id from ISAM session and use that data as API call input. Any idea? Thanks in advance.

    ------------------------------
    David Vicenteño
    ------------------------------


  • 2.  RE: How HTML page can get the user id from ISAM session

    Posted Wed October 30, 2019 03:34 PM
    Hi,

    You can use the InfoMap capability in ISAM to send back the username to the HTML as a MACRO. You can create an InfoMap authentication policy which will return your HTML page after processing some JavaScript (mapping rule). Inside this mapping rule, you can get the username from the session and populate it in the HTML MACRO before returning the page. The value will then be available in the HTML MACRO once the page is loaded. You can then use javascript to get its value and insert it in the API call.

    //Getting username from session inside infomap:
    var username = context.get(Scope.SESSION, "urn:ibm:security:asf:response:token:attributes", "username");

    //Populating macro
    macros.put("@USERNAME@", username);

    //Returning the HTML page
    page.setValue("/authsvc/authenticator/<custom_infomap>/myPage.html");

    Also, remember to set success value to false in the mapping rule as shown below because this page is never used for actual authentication..

    //Setting success value in infomap mapping rule
    success.setValue(false);

    Hope it helps,

    Regards,

    ------------------------------
    Jahanzaib Sarwar
    ------------------------------



  • 3.  RE: How HTML page can get the user id from ISAM session

    Posted Mon November 04, 2019 11:24 AM
    Hi Jahanzaib thaks for answering my question, your answer helps me a lot I have resolved my problem. Reggards.

    ------------------------------
    David Vicenteño
    ------------------------------