English 中文(简体)
Can I port Glassfish jdbcRealm to JBoss?
原标题:

My application is running on Glassfish 3.1 using jdbcRealm is its authentication and authorization. I want to port this app to JBoss 6. Can I create a jdbcRealm inside JBoss 6 like in Glassfish3 that map to a USER table in my database? Can I do it via admin-console? In JBoss, I figure out how to create database connection (just by create datasource), but in Glassfish I also set up JavaMail Sessions in Glassfish with jndi, mail-host, transport protocol..., can I port that over to JBoss as well?

最佳回答

Answers on your questions:

Can I create a jdbcRealm inside JBoss 6 like in Glassfish3 that map to a USER table in my database?

If I understand correctly you use database to authenticate users?

You can define something like that in JBoss. The easiest way is to add proper security domain definition to the conf/login-config.xml file.

It can looks like that:

<application-policy name="database-domain">
  <authentication>
    <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
      <module-option name="dsJndiName">java:/yourDataSource</module-option>
      <module-option name="principalsQuery">select password from users where userid = ?</module-option>
      <module-option name="rolesQuery">select role,  Roles  from roles where userid = ?</module-option>
    </login-module>
  </authentication>
</application-policy>

You should also create proper data source and put database library to the lib directory.

Can I do it via admin-console?

I do not know if it is possible to make these changes using web console.

In JBoss, I figure out how to create database connection (just by create datasource), but in Glassfish I also set up JavaMail Sessions in Glassfish with jndi, mail-host, transport protocol..., can I port that over to JBoss as well?

JBoss use default database to store some information. If you want to change that the simples way is to define new data source with the DefaultDS name and delete the deploy/hsqldb-ds.xml file.

In JBoss 6 they change JMS provider and it also use its own DB to stre some info, bu I don t know if and how to change it.

问题回答

暂无回答




相关问题
Implementing SSO with SAML and JBoss

I want to implement SSO with SAML tokens in JBossAS. The scenario is as follows. I have 2 applications app1 and app2 running on 2 JBoss instances. Login into app1 and enter username / password ...

How do you efficiently repeat an action every x minutes?

I have an application that runs in JBoss. I have an incoming web service request that will update an ArrayList. I want to poll this list from another class every 60 seconds. What would be the most ...

jsp:how to hide folder structure of website from users?

how to hide folder structure of website from users. i have developed a website on jave platform (jsp). website is deployed on jboss. suppose my website s home page url is dummy.com/dummyFolder/...

JBoss Web Services Behind IIS Through HTTPs

This is a tangled web that s woven, I suppose, but it really shouldn t be all that hard. Let me see if I can paint the picture: I have written a web service, starting with a WSDL, which is to run in ...

Flex: image scale stopped working after deploy to server

I have some code to scale an image s width according to its height after the image is being loaded. It works fine on my development PC if I point to the wrapper html using local file system path. ...

How in jboss write traces to separate trace file

How in JBoss to write traces to separate file? I would like to see traces about org.hibernate.SQL and org.hibernate.type in separate trace file. I added next appender and categories to jboss-log4j....

热门标签