0
votes

I'm using OpenAM for authentication on my application. I access to my app using such URL:

http://my.company.com/appfolder/appservlet?lang=EN&user=test

On first access, OpenAM agent catches the URL and redirect my browser to the authentication page using this redirection URL:

...openam/UI/Login?goto=http%3A%2F%2Fmy.company.com%3A8080%2Fappfolder

After correct authentication, I'm finally redirected to the following URL:

http://my.company.com/appfolder

This is logic since this is the URL referenced in goto param. But it's not the same than original one: the servlet and custom params (lang and user) are missing.

Any idea how to configure my agent to make it keep servlet and params after redirection ?

2

2 Answers

0
votes

take a look at this step of the tutorial "Add Authentication to a Website using OpenAM".

In section "Creating An Access Policy" -> "Wildcard matching" is your answer:

The wildcard * in policy URLs does not match '?'. As such if you wish to allow GET parameters to be submitted then a second policy for http://webserver.example.com/*?* is required.

0
votes

Thanks for your answer. As mentionned in my previous comment, the adding of new policy does not resolve my issue. Actually, I'm not sure to understand how the policies can solve the issue since the goto parameter is generated by the J2EE agent, which acts before policies are applied (as far as I know... I'm maybe wrong).

Anyway, I could solve my problem by re-compiling the J2EE Agent: I've build a new agent.jar based on v3.0.3 available at forgerock. Then I replaced the AmFilterRequestContext.class by a new one, build on source available here: http://www.docjar.com/html/api/com/sun/identity/agents/filter/AmFilterRequestContext.java.html

With this new agent, my goto is now correct, and redirection works well (and I don't have to define any policy).

The strange thing is that I don't understand why it works now ! I couldn't find any difference between java source mentionned above and uncompiled version of original class! I just added some System.out.println to get variables values and functions results, and built the jar. After restaring my jboss, the goto was correct. I'll try to understand why this finally work now when I've time.