Symantec Access Management

Expand all | Collapse all

i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

  • 1.  i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Jul 30, 2015 10:26 PM

    i have a html app which consists of lot of html pages so i need to validate sitminder headers in html page how can i validate or get siteminder headers with javascript



  • 2.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript
    Best Answer

    Posted Jul 30, 2015 11:23 PM

    Hello,

     

    It is not possible to read HTTP Response Headers ( Not just SiteMinder) using Javascript for the current page request without actually issuing another request which might or might not result in the same response headers.

    This has nothing to do with the SiteMinder.

    You can refer to following thread which has some discussion around the same use case :

    http://stackoverflow.com/questions/220231/accessing-the-web-pages-http-headers-in-javascript

     

    What are other options : ?

    • Use server side programming language like ASP/JSP etc with which you can retrieve the headers.
    • Instead of using HTTP Response headers use Cookies

     

    Cheers,

    Ujwol Shrestha



  • 3.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Jul 30, 2015 11:54 PM

    Hi,

     

    Siteminder has some default headers after user auth/az

     

    ie:

    HTTP_SM_USER

    HTTP_SM_USERDN

    HTTP_SM_UNIVERSALID

     

    Try

    req.getAllResponseHeaders().

     

    if it prints out all headers.



  • 4.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Jul 31, 2015 12:45 AM

    Unfortunately, as I explained above, this won't help unless we are making a new request to the same resource using JavaScript (XMLHttpRequest)



  • 5.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Jul 31, 2015 01:14 AM

    hi ujwol

    thanks for your suggestion

    my issue is there is a html app which consists of arround 75 html pages in iis 7.5 now it is moving to sso siteminder my work is to validate siteminder headers throughout the app on any link

    so can you give any suggesstion without converting html to asp  pages is there any solution for this please



  • 6.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Aug 03, 2015 07:24 PM

    Hi,

    Server side language is best to address. However, since you have existing html pages, I was thinking if you can try use the refresh tag and check if the java script can retrieve the headers.

    I haven't tested this but just an idea pop up in my mind

     

    <html>
     
    <head>
       
    <title>HTML refresh every 30 seconds</title>
       
    <meta http-equiv="refresh" content="30">
     
    </head>
     
    <body>
     
    </body>
    </html>



  • 7.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Aug 03, 2015 07:54 PM

    If this is a one time testing of headers then probably using Wireshark to view Network trace would be enough..without involving any additional programming.



  • 8.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Aug 06, 2015 09:45 PM

    we can get response headers with java script i tried with this xmlhttprequest i need request headers

    this is not one time testing ujwol



  • 9.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Aug 06, 2015 10:22 PM

    Hi srn,

     

    Yes that will work. But as I explained previously there is catch.

    The way this works is as follows :

     

    1. Browser sends request for resource /test.html

    2. Server sends the response (including the http headers & javascript which has the XMLHTTPRequest code to get headers)

    3. Browser executes the java script , thus making a new XMLHTTPRequest for the same resource /test.html

    4. Server sends the response for the new XMLHTTPRequest..Print the headers.

     

    So as you could see above, for this to work, browser has to make a new request to the server for the resource.

     

    So as long as there is a guarantee that response headers are the same for a particular request(resource) irrespective of how many time you request it ..then this solution will work.

    But also please be careful this solution will have performance overheads to your application if you are going to have this javascript built into all of your application pages.

     

    Cheers,

    Ujwol Shrestha



  • 10.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Aug 06, 2015 10:28 PM

    hi ujwol

     

    sorry we can get only response headers not request headers with xmlhhtprequest i need request headers



  • 11.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Aug 04, 2015 05:20 PM

    Hello,

     

    Create a page like header.aspx protected by your IIS agent and put this code inside:

     

    <%

    For Each var as String in Request.ServerVariables

      Response.Write(var & " " & Request(var) & "<br>")

    Next

    %>


    This page will display all the Headers.

     

    Denis



  • 12.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Aug 05, 2015 11:29 AM

    thanks Denis for your reply

     

    can u please explain how can i validate headers for every html page with the above code in aspx page



  • 13.  Re: i have a html app in iis 7.5 i need to validate siteminder headers so how can i get siteminder headers in javascript

    Posted Aug 07, 2015 11:43 AM

    there's also a set of dump pages that  ca support can provide.

     

    they will  dump  the headers. as long as they are protected  it  will have the SM Headers.

    any page pulled that is protected will have the same SM Headers... etc