Its been a few days since I wrote anything. Im probably going to forget some details
So as it turns out, I grabbed the wrong rails openid consumer plugin. The correct plugin can be found at http://identity.eastmedia.com/identity/show/Consumer+Plugin. The site also has a rails openid server.
I ran into issues trying to populating form data in a dynamically created window. The intended functionality was to have Flex open a new window with a text input form box. The text input form box was to be populated by Flex and then submitted to the rails backend consumer for processing. The idea here was to keep the flex app still while have the new window do the required redirects for authentication. After authentication, the window was supposed to send session data back to the awaiting flex application.
I couldn’t populate the value of open_id_uri because I am an idiot
var newWin = window.open(‘/open_id/index’, . . . . )
function callByFlex(flex_open_id_url){
newWin.document.getElementById(“openid_url_id”).value = flex_open_id_url
}
html:
<input type=”text” id=”openid_url_id” name=”openid_url” style=”width: 200px” value=”” />
For whatever reason, newWin.document.getElementById(“openid_url_id”) returned null
I don’t remember if I created the window within callByFlex() because if that were the case, then it would make sense that the form wasn’t populated. The window probably didn’t get loaded before the next line of code got executed. One way to fix this would probably be to have a separate handler to open the window, and then have a JS event “onload” to make an ajax call to Flex to extract the openID_uri. This seems like a lot of overhead just to send an openID_uri.
Never the less, i’ll try it.
I came up with another idea, why not just embed the flex app right into the rails rendered html, so basically inject the js and swf files into the view of controlled actions. This seemed to work fairly well because I could render the session into the view of the controlled action and use the ajax bridge to extract the session as soon as the flex app finished loading. There is however draw backs. First, if authenticating with openid, the window will redirect and the flex app will have to reload. Second, after authentication, the flex app will have to do an extra http service call to the rails backend to verify the authentication. I have yet to implement the extra http service call to the rails backend to verify the authentication.
Do I need to insert a salt value on the authentication verification?