[JBoss Portal] - Re: problem about cas sso:DBIdentityLoginModule can not get
by jsports
| import javax.security.auth.login.LoginException;
| import javax.security.jacc.PolicyContext;
| import javax.servlet.http.HttpServletRequest;
| import org.jboss.portal.identity.auth.DBIdentityLoginModule;
|
| public class CRMDBIdentityLoginModule extends DBIdentityLoginModule {
|
| @Override
| protected boolean validatePassword(String inputPassword,
| String expectedPassword) {
| // logger.info("inputPassword=="+inputPassword);
| // logger.info("expectedPassword=="+expectedPassword);
| HttpServletRequest request = null;
| try {
| request = (HttpServletRequest) PolicyContext
| .getContext("javax.servlet.http.HttpServletRequest");
| } catch (Exception e) {
| log.error(this, e);
| throw new RuntimeException(e);
| }
| Object ssoSuccess = request.getAttribute("ssoSuccess");
| // logger.info("ssoSuccess=="+ssoSuccess);
| if (ssoSuccess != null) {
| return true;
| }
| return super.validatePassword(inputPassword, expectedPassword);
| }
|
|
| @Override
| protected String createPasswordHash(String username, String password,
| String arg2) throws LoginException {
| return password;
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173502#4173502
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173502
16 years, 4 months
Delivery Status Notification (Failure)
by postmaster@lists.jboss.org
This is an automatically generated Delivery Status Notification.
Delivery to the following recipients failed.
infon@localhost
16 years, 4 months
[Persistence, JBoss/CMP, Hibernate, Database] - JBoss Hibernate MBean deployment question
by babernat
Hi,
I'm using JBoss 4.2.3GA and am attempting to use the hibernate mbean to provide JNDI access to a hibernate SessionFactory. I'm having some problems in that when I look up the SessionFactory object via JNDI, the object returned is null. So, in trying to figure out why, I'm noticing something in the app server console that I am curious about so I was wondering what it means:
| 22:42:56,484 INFO [SettingsFactory] Echoing all SQL to stdout
| 22:42:56,484 INFO [SettingsFactory] Statistics: disabled
| 22:42:56,484 INFO [SettingsFactory] Deleted entity synthetic identifier rollbac
| k: disabled
| 22:42:56,484 INFO [SettingsFactory] Default entity-mode: pojo
| 22:42:56,484 INFO [SettingsFactory] Named query checking : enabled
| 22:42:56,515 INFO [SessionFactoryImpl] building session factory
| 22:42:56,656 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no
| JNDI name configured
| 22:42:56,656 INFO [SchemaExport] Running hbm2ddl schema export
| 22:42:56,656 INFO [SchemaExport] exporting generated schema to database
| 22:42:56,656 INFO [SchemaExport] schema export complete
| 22:42:56,656 INFO [NamingHelper] JNDI InitialContext properties:{}
| 22:42:56,656 INFO [Hibernate] SessionFactory successfully built and bound into
| JNDI [java:/hibernate/ExampleSessionFactory]
|
Ok so what's confusing is the INFO that says: Not biding factory to JNDI, no JNDI name configured.
Then the last line states something that seems contradictory:
SessionFactory successfully built and bound into JNDI [java:/hibernate/ExampleSessionFactory]
Am I not understanding something? Any insight would be appreciated. Here's my jboss-service.xml file for the har.
| <server>
| <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
| <attribute name="DatasourceName">java:/DefaultDS</attribute>
| <attribute name="Dialect">org.hibernate.dialect.HSQLDialect</attribute>
| <attribute name="SessionFactoryName">java:/hibernate/ExampleSessionFactory</attribute>
| <attribute name="Hbm2ddlAuto">create-drop</attribute>
| <attribute name="ShowSqlEnabled">true</attribute>
| </mbean>
| </server>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173491#4173491
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173491
16 years, 4 months
Delivery Status Notification (Failure)
by postmaster@lists.jboss.org
This is an automatically generated Delivery Status Notification.
Delivery to the following recipients failed.
vsviridovd@localhost
16 years, 4 months
[JBoss Portal] - Re: problem about cas sso:DBIdentityLoginModule can not get
by jsports
the class I write:
|
| import javax.security.auth.login.LoginException;
|
| import org.apache.log4j.Logger;
| import org.jboss.portal.identity.auth.IdentityLoginModule;
|
| public class CRMIdentityLoginModule extends IdentityLoginModule{
| private static final Logger logger = Logger.getLogger(CRMIdentityLoginModule.class);
| @Override
| protected boolean validatePassword(String inputPassword, String expectedPassword) {
| logger.info("inputPassword="+inputPassword+",expectedPassword="+expectedPassword);
| return super.validatePassword(inputPassword, expectedPassword);
| }
| @Override
| protected String[] getUsernameAndPassword() throws LoginException {
| String [] strs = super.getUsernameAndPassword();
| for(String str:strs){
| logger.info("str==="+str);
| }
| return strs;
| }
| @Override
| protected String createPasswordHash(String username, String password, String arg2)
| throws LoginException {
| logger.info("arg0==="+username);
| logger.info("arg1==="+password);
| logger.info("arg2==="+arg2);
| return super.createPasswordHash(username, password, arg2);
| }
| }
|
| result:
|
| 10:55:15,765 INFO [CRMIdentityLoginModule] str===029
| 10:55:15,765 INFO [CRMIdentityLoginModule] str===null
| 10:55:15,765 INFO [CRMIdentityLoginModule] inputPassword=null,expectedPassword=
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173488#4173488
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173488
16 years, 4 months
[JBoss Portal] - Re: problem about cas sso:DBIdentityLoginModule can not get
by jsports
thanks Sohil.
yes.
I have read the articles I can find about cas sso for jboss portal and successed.
Now,what I want to do is use our db instead of portal db as the user data of sso.
because our user password is custom encrypted ,so org.jboss.portal.identity.crm.DBIdentityLoginModule
can not authenticate successfully,
so should be decrypted it before authentication.
I have do a test:
write a sub class of IdentityLoginModule and DBIdentityLoginModule,just override the validatepassword(String inputpassword,String expectedpassword) method ,log the value of the parameters.
In the validatepassword method,the value of input password parameter is null.
But with the IdentityLoginModule provided by portal,it still ahtenticates successfully.
I have downloaded the jboss-4.23-src,
try to trace the login method and see what happened .
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173486#4173486
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173486
16 years, 4 months
[EJB 3.0] - @Management and JBoss 4.2.1
by bforney
Hi,
I'm new to the forums and new to JBoss, but have used Tomcat and Spring before in at a prior employer. Feel free to ask basic questions or make basic comments given my experience level with JBoss.
I'm trying to deploy a POJO as a JBoss EJB3.0 Service (using the @Service annotation) with a JMX interface (using the @Management annotation). Both of these annotations are JBoss extensions for EJB3.0. The Service is deployed, but the Management annotation doesn't lead to an MBean by the objectName I've specified and hence JMX clients can't find the MBean. I've looked for the MBean in both the JMX console provided on port 8080 and using a JMX connection from a simple Java program. I'd love any help in understanding why the MBean specified by the @Management(objectName=...) isn't appearing the JMX server.
Here's what I am doing:
- JBoss v 4.2.1
- @Service class:
@Service(objectName="integral7:service=RecordManager")
@Management(RecordManagerMBean.class)
@TransactionAttribute(TransactionAttributeType.NEVER)
public class RecordManager extends NotificationBroadcasterSupport
implements NotificationListener, RecordManagerMBean {
[...]
public static final ObjectName MBEAN_NAME;
private static final Exception MBEAN_NAME_EXCEPTION;
static {
Exception exception = null;
ObjectName objName = null;
try {
// This should always match the objectName value of the
// @Service annotation
objName = new ObjectName("integral7:service=RecordManager");
} catch (final Exception e) {
exception = e;
} finally {
MBEAN_NAME = objName;
MBEAN_NAME_EXCEPTION = exception;
}
}
[...]
}
- @Management class:
public interface RecordManagerMBean extends NotificationEmitter {
}
- Client code:
private Object invokeRecordManager(
final String operation,
final Object... args
) {
try {
InitialContext ctx = new InitialContext(); // From jndi.properties
MBeanServerConnection server =
(MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor");
// generate the signature
List signature = new ArrayList();
for (final Object arg : args) {
signature.add(arg.getClass().getName());
}
return server.invoke(
RecordManager.MBEAN_NAME, operation,
args, signature.toArray(new String[] {})
);
} catch (final Exception e) {
final StringWriter sw = new StringWriter();
final PrintWriter pw = new PrintWriter(sw, true);
e.printStackTrace(pw);
pw.flush();
sw.flush();
return e.toString() + ": " + sw.toString();
}
}
- Have read and tried the different methods outlined in:
http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/j...
http://docs.jboss.org/ejb3/app-server/tutorial/service/service.html
In essence, I want a singleton object that can be accessed via JMX remotely. Any suggestions and questions are welcomed.
Brian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4173481#4173481
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4173481
16 years, 4 months