Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Add to HTTP header with HTMLPane

    I am using HTMLPane to display a web page/application from another application. We’re trying to use this to implement a single sign on portal for several applications. To use single sign on we need to load the landing page with information in the HTTP header. Is there a way to put something in the HTTP header while using the HTMLPane API?

    #2
    There's not currently a way to do this.

    If this is related to authentication, you might be able to make a request to the other application first to perform a login, and if this results in a cookie being set, that cookie would be expected to be included automatically when you make a subsequent request for the content that you want to place in the HTMLPane.

    If, instead, the other application requires special HTTP headers with *every* request, note that in the case of contentsType:"page", there's no way for JavaScript code to influence the request headers that are sent when an <iframe> is injected into the DOM.

    We did find, however, this approach (see last answer), which uses some relatively recently added low-level browser APIs to request content (with headers specified) and then turns the loaded content into a URL that should work with HTMLPane.contentsURL. However, we haven't looked at browser compatibility for this approach - let us know if you'd like us to look into it for you.

    Comment

    Working...
    X