Tuesday, June 17, 2014

Single-Sign On with HttpClient

Recently we have to get rid of our Old Single Sign on Software(Siteminder) and had to onboard a new Single Sign on (OID/OIM). While doing so, not all of our applications are compatible with the new SSO application.

One of the requirements is,
We got an Production Existing Portal Application, (Say Portal-P) which is having a navigation link to another Web Application(Miserable-M).  Portal-P is just having the static URL for Miserable-M and since both are SSO protected by Siteminder, the user specific credentials are being handled by Siteminder.  Since we are  removing Siteminder, the question is how the user credentials will be passed going P to M.   To add to our woes, "Miserable-M" is also not LDAP compatible.  But "M" has its own database where it will look for a "User Id"(No Passwords) for "Authorization" purposes.

So we removed the Siteminder protection to M and using Fiddler I captured all the http events happening at the background.  There are multiple http request/responses that were happening before the actual user look up in M.   Then I used Apache HttpClient Code to connect to M for authenticating a session.  I got this code embedded into Portal-P.  So when a user clicks on the Navigation link for "M", there will be a server call(Ajax or Servlet or Managed Bean) to get an authenticated session id and then a window.open() is used to open the new window in a popup.

http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit

http://stackoverflow.com/questions/5554896/window-open-post

http://www.mywebexperiences.com/2008/01/26/send-a-post-request-to-a-popup/

http://taswar.zeytinsoft.com/2010/07/08/javascript-http-post-data-to-new-window-or-pop-up/

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

http://stackoverflow.com/questions/17829983/window-open-location-no-address-bar-is-not-visible-in-ie

http://stackoverflow.com/questions/14146883/how-can-i-open-a-window-popup-in-servlet-and-then-redirect-a-page

http://www.java-forums.org/javaserver-pages-jsp-jstl/38370-how-use-window-open-jsp-call-servlet-open-jsp-new-window.html

http://stackoverflow.com/questions/245124/setting-onload-event-for-newly-opened-window-in-ie6

http://stackoverflow.com/questions/1185305/add-onload-function-to-an-opening-window

http://stackoverflow.com/questions/14146883/how-can-i-open-a-window-popup-in-servlet-and-then-redirect-a-page

http://www.w3schools.com/jsref/met_win_open.asp

http://www.howtocreate.co.uk/perfectPopups.html

http://theheat.dk/blog/?p=2059

No comments: