Featured post
Flex App Embedded in Rails App w/Authentication -
we have rails 3 app using session-based authentication (modified acts_as_authenticated), , flex app needs embedded in html.erb template. flex app needs access routes have before_filter set check if user logged in. when interacting html site, causes user redirected login page, sets rails session property (tied cookie) record user logged in when making future requests.
the flex app needs access xml that's generated rails (behind before_filter) , don't want force user log in twice -- should passing flash parameter flex app can present "already logged in" if session exists (ie, user has logged in via html interface)? haven't dealt kind of problem before i'm not sure if i'm asking right question. advice appreciated!
integrating flash authenticated service can tricky. can't rely on normal http sessions or cookies manage authentication you. regarded best practice generate unique token each logged in user pass on every request server prove in fact logged in user. example:
- they log in through html form.
- when serve swf going access authenticated content give flashvar of token=49r03f0239fhduffnkdjfgnas or that.
- this token generated server-side , stored somewhere checked on requests.
- on every request server pass token , check it's validity.
- if it's perform action , return data.
- if it's bad prompt user.
notes:
- tokens should long , unguessable session variable.
- each time log in need generate new token.
- each time log out need destroy token.
- Get link
- X
- Other Apps
Comments
Post a Comment