[JBoss Portal] - Re: User Login
by den74
> How do I login in the portal using this users?
I have solved a similar problem after some tests, implementing my MyLoginModule that extends UsersRolesLoginModule and in this redefined some methds:
(only some part of code)
// to save locally the user
protected String[] getUsernameAndPassword() throws LoginException {
String[] userAndPassword = super.getUsernameAndPassword();
this.user = userAndPassword[0];
return userAndPassword;
}
// to use my validation
protected boolean validatePassword(String arg0, String arg1) {
boolean result = myValidation.login(this.user, arg0);
return result;
}
remember you have to configure portal to use your class:
in jbPortal/server/default/conf/login-config.xml
add you application policy like
<application-policy name = "My_Authentication">
<login-module code ="it.deltadator.security.auth.spi.MyLoginModule"
flag = "required" >
<module-option name="additionalRole">Authenticated</module-option>
</login-module>
</application-policy>
and then use it as security domain changing reference in
server\default\deploy\jboss-portal.sar\portal-server.war\WEB-INF\jboss-web.xml
> How i get the user logged?
In your class you can access to user logged using getUserPrincipal from ProtletRequest
hope you get it useful
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4015679#4015679
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4015679
19Â years, 2Â months
[JBoss Seam] - Re: unit tests in a seam-genned app
by clivehackney
Matt,
I was having the same issue, but I fixed it buy adding the following line to the none jta datasource you set up.
| <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider" />
|
so your booking local source should read.
<persistence-unit name="bookingLocal" transaction-type="RESOURCE_LOCAL">
| <properties>
| <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
| <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
| <property name="hibernate.connection.username" value="sa"/>
| <property name="hibernate.connection.password" value=""/>
| <property name="hibernate.connection.url" value="jdbc:hsqldb:."/>
| <property name="hibernate.max_fetch_depth" value="3"/>
| <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider" />
| </properties>
| </persistence-unit>
I went back and tried the original persistence-test.xml file, which I added the above line to, this also fixed the tests. It appears the the bootstrap bean in the jboss-beans.xml dosn't pick this up.
my persistence-test.xml now reads.
| <persistence-unit name="bookings">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/bookingsTestDatasource</jta-data-source>
| <properties>
| <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
| <property name="hibernate.show_sql" value="true"/>
| <property name="jboss.entity.manager.factory.jndi.name" value="java:/bookingsEntityManagerFactory"/>
| <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider" />
| </properties>
| </persistence-unit>
|
Hope that makes some sense.
Clive
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4015678#4015678
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4015678
19Â years, 2Â months
[Messaging, JMS & JBossMQ] - Re: Using CsIL
by markuskolp
Hi, I'm using Jboss 4 and XIL2 and can't get your examples working.
I get a problem when trying to create a Connection-Object.
| ...
| Connection conn = factory.CreateConnection(auth);
| // alternative: Connection conn = factory.CreateConnection();
| // alternative: Connection conn = new Connection(auth, factory);
| ...
|
The stacktrace says following:
| Object reference not set to an instance of an object.
|
| at tamalesoftware.messaging.Connection.Authenticate(AuthenticationRequest pAuthRequest)
| at tamalesoftware.messaging.Connection..ctor(AuthenticationRequest pAuth, ConnectionFactory pFactory)
| at tamalesoftware.messaging.ConnectionFactory.CreateConnection(AuthenticationRequest pAuth)
| at TryAndError.Form1.btnCSILsendMessage_Click(Object sender, EventArgs e) in c:\...\TryAndError\Form1.cs:line 211
|
I tried to use the keyword "new", but that doesn't work either.
Here is my complete listing:
| private void btnCSILsendMessage_Click(object sender, EventArgs e)
| {
| try
| {
|
| ConnectionFactory factory = new ConnectionFactory();
| factory.Config.ServerAddress = "10.252.103.201";
| factory.Config.Port = 8094;
| factory.Config.PingPeriod = 10;
|
| //======================================================================
|
| factory.Config.Username = "admin";
| factory.Config.Password = "admin";
| factory.Config.TcpNoDelay = false;
| factory.Config.ServerILName = "tamalesoftware.messaging.csil.xil2.XIL2ServerIL";
| factory.Config.ClientILServiceName = "tamalesoftware.messaging.csil.xil2.XIL2ClientILService";
| factory.Config.Xil2blockwriterblocksize = 128;
| factory.Config.Xil2blockwriterdelimiterchar = 0;
| factory.Config.Xil2blockwriterpaddingchar = 32;
| factory.Config.Usessl = false;
|
| //======================================================================
|
| AuthenticationRequest auth = new AuthenticationRequest("admin", "admin");
| //Connection conn = new Connection(auth, factory);
| Connection conn = factory.CreateConnection(auth);
| conn.Start();
|
| Session session = new Session(conn, AcknowledgementTypes.AUTO_ACKNOWLEDGE);
| Topic topic = conn.CreateTopic("topic/SMCTopic");
| ITopicSubscriber subscribe = session.CreateSubscriber((ITopic)topic);
| subscribe.Listen += new OnMessageEventHandler(doEvent);
|
| ITopicPublisher publish = session.CreatePublisher((ITopic)topic);
| TextMessage message = new TextMessage();
| message.Text = "This is a test.";
| publish.Send(message);
| MessageBox.Show("message sent");
|
| }
| catch (Exception ex)
| {
| MessageBox.Show(ex.Message);
| MessageBox.Show(ex.StackTrace);
| txtCSILMessage.Text = ex.Message + " " + ex.StackTrace;
| }
|
|
| }
|
| public void doEvent(object sender, OnMessageEventArgs args)
| {
| MessageBox.Show("--> " + args.Message);
| }
|
Any advice?
Thanks, Markus
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4015675#4015675
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4015675
19Â years, 2Â months