Emeres
Emeres

Reputation: 33

Primefaces dialog framework + SSO url rewriting

I have problem with opening dialog using Primefaces dialog framework. We are using SSO solution to provide security to our application by integrating with internal company SSO solution.

In short. Our real address (without sso) to application on our server is e.g.: https://appserver1.net/ctx/page.xhtml (where ctx is root context of our app) In normal case we get sso address e.g.: https://ssoaddress.net/junction/page.xhtml where junction=ctx. During request sso address is rewritten to find real address of our server, get resources and response again rewritting to sso url address. Everything works fine. But we got second env (DEV02) on which due to some limitation we got sso addres where junction!=ctx like: https://ssoaddress.net/junction/ctx/page.xhtml. In that case when i am trying to open dialog i got information: "page.xhtml Not Found in ExternalContext as a Resource".

Working code when junction=ctx:

public void openTestPage() {        
    Map<String,Object> options = new HashMap<String, Object>();
    options.put("resizable", false);
    options.put("draggable", true);
    options.put("modal", true);
    options.put("height", 250);
    options.put("contentHeight", "100%");
    options.put("closable", true);
    RequestContext.getCurrentInstance().openDialog("/pages/page", options, null);
}

Due to fact that junction is different than context during rewriting is not possible to find requested page.html. Maybe someone of you knows how to solve this problem? I add that i cannot rewrite context of application. Technical info: primefaces 6.0, JSF2.2, weblogic 12.2.1. structure of resources: src/main/webapp/pages/page.xhtml

Upvotes: 0

Views: 145

Answers (1)

Vsevolod Golovanov
Vsevolod Golovanov

Reputation: 4216

Since you can't fix bad url rewriting due to some limitation, you're left with fixing it with another rewriting.

You may put in a separate proxy between your server and sso, that does the rewriting.
Or you may rewrite right in your app. You may create your own rewriting servlet filter or use a 3rd party solution, e.g. PrettyFaces.

Upvotes: 0

Related Questions