I  have tried to check like below:

        public UserDetails loadUserByUsername(String username)
                        throws UsernameNotFoundException {
                log.error("hello service10");

                // Create a metadata of the service
                Service serviceModel = new ObjectServiceFactory()
                                .create(UserWebService.class);
                log.error("callSoapServiceLocal(): got service model.");

                // Create a proxy for the deployed service
                XFire xfire = XFireFactory.newInstance().getXFire();
                XFireProxyFactory factory = new XFireProxyFactory(xfire);

                String serviceUrl =
"http://localhost:8089/jolmat/services/UserWebService";;

                UserWebService client = null;
                try {
                        client = (UserWebService) factory.create(serviceModel, 
serviceUrl);
                } catch (MalformedURLException e) {
                        log.error("WsClient.callWebService(): EXCEPTION: " + 
e.toString());
                }

                // Invoke the service
                UserDetails usr = null;
                try {
                        usr = client.getUserByUsername(username);
                } catch (Exception e) {
                        log.error("WsClient.callWebService(): EXCEPTION: " + 
e.toString());

                }

                log.debug("WsClient.callWebService(): status=" + 
usr.getUsername());
                return usr;
        }

the usr.getUsername() is null ! what happend actually? did I write a wrong
xfire client?



Michael Horwitz wrote:
> 
> Have you tried debugging to the object returned by the webservice? Or
> running a test on the objects returned by the webservice? It could be
> something is going wrong there.
> 
> Mike.
> 
> On 2/27/07, Plant More Tree <[EMAIL PROTECTED]> wrote:
>>
>>
>> I have already check the database that the account_enabled field is 'Y'.
>>
>>
>> Michael Horwitz wrote:
>> >
>> > It looks as if the isEnabled() function on the user returned from the
>> > service is returning false?
>> >
>> > On 2/27/07, Plant More Tree <[EMAIL PROTECTED]> wrote:
>> >>
>> >>
>> >> Hi Mike,
>> >>
>> >>   I actually try to deploy 2 appfuse, 1 in Tomcat 5 and another 1 in
>> >> JBoss4
>> >> and the appfuse in Tomcat is installed with xfire webservice by using
>> the
>> >> xfire install ant script in appfuse. The appfuse in JBoss4 is only
>> >> webservice client. Everything works fine and can see the wsdl for the
>> >> appfuse in Tomcat.
>> >>
>> >> For the appfuse in JBoss4,
>> >>
>> >> I have implements UserDetailsService for UserManagerImpl and also
>> >> implemented the loadUserByUsername as follows:
>> >>
>> >>
>> >>
>> >> public UserDetails loadUserByUsername(String username)
>> >>                        throws UsernameNotFoundException {
>> >>
>> >>                // Create a metadata of the service
>> >>                Service serviceModel = new ObjectServiceFactory()
>> >>                                .create(UserWebService.class);
>> >>
>> >>                // Create a proxy for the deployed service
>> >>                XFire xfire = XFireFactory.newInstance().getXFire();
>> >>                XFireProxyFactory factory = new
>> XFireProxyFactory(xfire);
>> >>
>> >>                String serviceUrl =
>> >> "http://localhost:8089/appfuse/services/UserWebService";; // in Tomcat5
>> >>
>> >>                UserWebService client = null;
>> >>                try {
>> >>                        client = (UserWebService)
>> >> factory.create(serviceModel,
>> >> serviceUrl);
>> >>                } catch (MalformedURLException e) {
>> >>                        log.error("WsClient.callWebService():
>> EXCEPTION:
>> "
>> >> + e.toString());
>> >>                }
>> >>
>> >>                // Invoke the service
>> >>                UserDetails usr = null;
>> >>                try {
>> >>                        usr = client.getUserByUsername(username);
>> >>                } catch (Exception e) {
>> >>                        log.error("WsClient.callWebService():
>> EXCEPTION:
>> "
>> >> + e.toString());
>> >>
>> >>                }
>> >>
>> >>                return usr;
>> >>        }
>> >>
>> >> and I also have taken out the UserDetailsService implement in
>> >> UserDaoHibernateImpl.
>> >>
>> >> and in the security.xml, I change to
>> >>
>> >> property name="userDetailsService" ref="userManager"
>> >>
>> >> under rememberMeServices and daoAuthenticationProvider.
>> >>
>> >> After deploying and tried to login, I got a message like
>> >>
>> >> 2007-02-27 19:48:57,521 INFO  [STDOUT] 19:48:57,521 WARN
>> >> [LoggerListener]
>> >> Authentication event AuthenticationFailureDisabledEvent: mraible;
>> >> details:
>> >> [EMAIL PROTECTED]:
>> RemoteIpAddress:
>> >> 127.0.0.1; SessionId: sK4Ct1Gbt3T2Abn5Xrwr8A**.node1; exception: User
>> is
>> >> disabled
>> >>
>> >> and unable to login. Appreciate if you could assist here. Thanks !
>> >>
>> >> Mark
>> >>
>> >>
>> >>
>> >>
>> >> Michael Horwitz wrote:
>> >> >
>> >> > As long as your userManager implementation implements
>> >> > org.acegisecurity.userdetails.UserDetailsService you can use it for
>> >> > authentication. Once you have implemented the interface in your user
>> >> > manager
>> >> > set it as the userDetailsService property on the
>> >> daoAuthenticationProvider
>> >> > bean in security.xml. Note that the user class returned by your
>> service
>> >> > also
>> >> > needs to implement the org.acegisecurity.userdetails.UserDetails
>> >> > interface.
>> >> >
>> >> > Mike.
>> >> >
>> >> > On 2/27/07, Plant More Tree <[EMAIL PROTECTED]> wrote:
>> >> >>
>> >> >> Hi, I understand that when login, acegi will forward the
>> >> authentication
>> >> >> info enter by the user to userDao class directly. Is it possible to
>> go
>> >> >> thru
>> >> >> userManager? if yes, how to configure the security.xml? I m asking
>> >> this
>> >> >> because my webapp user info is store in a center database and I use
>> >> xfire
>> >> >> webservice to access the webservice in the other webapp which
>> >> connected
>> >> >> to
>> >> >> the center user database. I have tried to change to but failed.
>> >> >> Appreciate
>> >> >> any help or comment here. Thanks & Regards, Mark
>> >> >> ------------------------------
>> >> >> View this message in context: how to Authenticate thru userManager
>> >> >> ?<
>> >>
>> http://www.nabble.com/how-to-Authenticate-thru-userManager---tf3299650s2369.html#a9178813
>> >> >
>> >> >> Sent from the AppFuse - User mailing list
>> >> >> archive<http://www.nabble.com/AppFuse---User-f2370.html>at
>> >> >> Nabble.com <http://nabble.com/>.
>> >> >>
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/how-to-Authenticate-thru-userManager---tf3299650s2369.html#a9180575
>> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/how-to-Authenticate-thru-userManager---tf3299650s2369.html#a9185507
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-Authenticate-thru-userManager---tf3299650s2369.html#a9186170
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to