English 中文(简体)
Java Application with Multiple JAAS Security Realms
原标题:

I was wondering if it was possible to have a Java EE application with multiple JAAS security realms. I m currently developing an application in which some users need to be authenticated with data stored in a database, while other users need to be authenticated through an LDAP bind.

So I created 2 security realms in glassfish 3.1, a JDBC realm and an LDAP realm and configured my web.xml to use the LDAP realm (most users are LDAP).

I then use :

  HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
  request.login(username, password);

to authenticate user

is it possible to switch to JDBC realm before calling request.login ?

thanks in advance

问题回答

Have you seen this?

Cross-Domain Single Sign-On Authentication with JAAS http://www.devx.com/security/Article/28849/1954

I have seen somewhere that you can configure to use two realms or two methods in one realm, that if the first fails it will try the second. I dont know where I saw it sorry. Perhaps that will point you in the right direction.

You must program your custom JAAS login module that try authenticate in method and if is not work try method B.

In you application is transparently all works in the JAAS login module.





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Remotely authenticating client Windows user on demand

Suppose I am writing a server for a particular network protocol. If I know that the client is running on a Windows machine, is it possible for my server to authenticate the Windows user that owns the ...

Role/Permission based forms authorizing/authentication?

While looking into forms authorizing/authentication, I found that it is possible to do role based authorizing by adding an array of roles to a FormsAuthenticationTicket. That way I can write User....

热门标签