views:

54

answers:

2

Here's a scenario: I have a java front end (RCP/SWT) app which currently has no authentication support. I have to however, add security to this application so that it gets deployed in different enterprise envinronments. I have a few approaches which I thought I would share with you all here and take your inputs. Please note that there are no strict requirements yet, so.. I would like you to consider typical and non-typical enterprise network security models.

Approach 1

  • Create a 'Security' webservice that the thick client would invoke, on startup.
  • The client queries the security for the current authentication mode and receives the implementation class of the authentication as a soap attachment. The class received, will not have the logic for authencation, rather it would just describe the UI and the events on the UI. (The client could make use of a GUI toolkit such as Thinlet?)
  • Once the class is loaded, a UI relating to the currently set authentication method is displayed to the end user.

Advantages:

  • This approach lets me handle different authentication schemes. For instance, if the app has to authenticate against user names and passwords stored in a database, a screen with UserName and password fields would suffice. However, say the user were to do a network logon that would involved typing in the network name, the UI would contain three fields. If the security model at the client network dictates ntlm/SSO based authentications, the user won't see a UI. This will also leave scope for future authentication methods - for instance, supporting a captcha specific logon screen/ biometric stuff / whatever.

Approach 2

KISS (Keepin in yea.., Simple)

  • User name and password are usually the only two credentials required by all of the known authenticating mechanisms?
  • Have the thick client query the webservice and let the webservice handle the entire authentication process.

I am not sure how realistic/feasible/commonly used the above mentioned approaches are. Appreciate your help.

+2  A: 

I'd certainly not recommend transmitting class definitions as SOAP attachments. A network classloader would make more sense, but is still not needed in your situation.

Put in the client what belongs there - the UI. Have the multiple screen types ready (i.e. defined as classes) on the client and activate each of them depending on a single value passed by the server. For example if AuthenticationType.CREDENTIALS is passed, go for username/password. If Authentication.SMART_CARD is - go for smart card.

If you want to distribute the application and later implement different auth screens, then use Java Web Start. Thus all clients will be guaranteed to be running the latest version.

After knowing that your requirements impose some limitations, take a look at this network classloaders article.

Bozho
@Bozho using java web start (jnlp) does make sense when you have your base product supporting a set of authentication methods and then you add another authentication mechanism, update dependency jar and then the app loads up new jar from the network. This is totally cool when we are doing this: "For example if AuthenticationType.CREDENTIALS is passed, go for username/password. If Authentication.SMART_CARD is - go for smart card." However, the idea here to alienate the client from knowing anything about how the authentication handshake is done.
Jay
From a cleaner design/ architecture perspective, don't you think it would help if the client knew nothing about different authentication UIs at runtime?
Jay
The client won't know _how_ the authentication is done. It will know just what data to request from the client to send to the server.
Bozho
how about UI? what if you wanted to support captcha in xyz corp envinronment, and what if you had to NTLM in another.? The UI has to change - this knowledge of what UI (and all the supported UIs) - need to be with the client - that is what I was trying to explain.
Jay
I understand well, and I'm saying that putting that UI on the client is OK for me. You can investigate into a network classloader, but it won't be that easy.
Bozho
sorry..I meant.. the knowledge of what UI (and all the supported UIs) need NOT be with the client. That is what my requirement is. Anyway, can you elaborate on the disadvatages of sending UI implementation class / UI scripts(such as thinlets) as SOAP attachments?
Jay
class versions, VM version. And the feeling that it's not a commonly used practice :)http://java.sun.com/developer/technicalArticles/Networking/classloaders/
Bozho
A: 

@Bozho

However, your suggested approach still requires installing/writing UI knowledge at the application before going live. Which means the application code has to be edited/updated everytime a new auth logic is to be implemented. I believe what the authr is trying to avoid.

chandan
this should be a comment. Then - I updated my answer to add info about how to achieve this.
Bozho