I have the following scenario for single sign on:
- Clicking link for web app on portal (http) get sso integration page.
- sso integration page comes for a while on browser..then it automatically (http)post data to the web-app with hidden fields
- Web app receives the request, extract user info from request parameters
- Web app makes a web service call to sso integration to see if the user is active
- on receiving positive response, web app display page.
I am using a preauthentication filter extending AbstractPreAuthenticatedProcessingFilter in spring security where I have overridden this function:
protected Object getPreAuthenticatedPrincipal(HttpServletRequest request) {
String username = getUserName(request); // Line1
// String username = "userA"; // Line2
return username; // Line 3
}
The function getUserName performs steps 3 and 4.
When I use Line 2(and not Line 1), everything works fine and user is able to see the web app page. When I use Line 1 and debug it, username is extracted same as in Line 2 without any exception but the user get HTTP error code 404. At Line 3, both scenarios have same value.
I am totally clueless about why this is happening or where is the error? :( Can anyone point me to the right direction?
UPDATE: The Http 404 response I recive is like this:
Response Headers Value
Set-Cookie JSESSIONID=b8f8615855da6e92d780f12e2bbe; Path=/<webapp>; Secure; HttpOnly
And on page refresh in browser, user is logged in and able to see the page. The jsessionid is not present as url parameter in case of refresh but when I am using Line 2, jsessionid is there as url parameter? I am not able to understand this behaviour.