You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@juddi.apache.org by jm...@telvent.com on 2011/08/16 15:26:54 UTC

Trying to make juddi console work with XMLDocAuthenticator

        Hello all:

        I have been trying for the last few days to make the juddi console 
(3.0.4) work with XMLDocAuthenticator. If I use JUDDIAuthenticator, 
everything is fine and I can see the contents of the directory in the 
portlets. However, if I enable the XMLDocAuthenticator in the jUDDI 
directory, I always get a "error: Invalid credentials were passed". 
Digging into it (using TCPMon), I found out that the cred was always being 
passed with an empty value to the get_authToken action:

POST /juddiv3/services/security HTTP/1.1
SOAPAction: "get_authToken"
Accept: text/xml, multipart/related, text/html, image/gif, image/jpeg, *; 
q=.2, */*; q=.2
Content-Type: text/xml;charset="utf-8"
User-Agent: JAX-WS RI 2.1.4-b01-
Host: 127.0.0.1:8888
Connection: keep-alive
Content-Length: 515
 
<?xml version="1.0" ?>
   <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
      <S:Body>
         <get_authToken xmlns="urn:uddi-org:api_v3"
                        xmlns:ns2="urn:uddi-org:custody_v3"
                        xmlns:ns3="urn:uddi-org:repl_v3"
                        xmlns:ns4="http://www.w3.org/2000/09/xmldsig#"
                        xmlns:ns5="urn:uddi-org:sub_v3"
                        xmlns:ns6="urn:uddi-org:subr_v3"
                        xmlns:ns7="urn:uddi-org:vscache_v3"
                        xmlns:ns8="urn:uddi-org:policy_v3"
                        xmlns:ns9="urn:uddi-org:vs_v3"
                        xmlns:ns10="urn:uddi-org:policy_v3_instanceParms"
                        cred="" userID="admin"/>
      </S:Body>
   </S:Envelope>
 
        Then I upped the debug level and got this:

INFO [org.apache.juddi.v3.client.config.WebHelper] - Starting Clerk 
Manager uddi-portlet-manager...
DEBUG [org.apache.juddi.v3.client.config.UDDIClerkManager] - 
uddi-portlet-manager already registered to the UDDIClientContainer.
DEBUG [org.apache.juddi.portlets.server.service.SecurityServiceImpl] - 
User null sending token request..
DEBUG [org.apache.juddi.portlets.server.service.SecurityServiceImpl] - 
UserPrincipal <user username="root" password="root" 
roles="pluto,tomcat,manager"/>
ERROR [org.apache.juddi.portlets.server.service.SecurityServiceImpl] - 
Could not obtain token. Invalid credentials were passed
javax.xml.ws.soap.SOAPFaultException: Invalid credentials were passed

        And digging into the code, I found this relevant fragment of code 
within the org.apache.juddi.portlets.server.service.SecurityServiceImpl 
class:

log.debug("User " + username + " sending token request..");
SecurityResponse response = new SecurityResponse();
String token = (String) session.getAttribute("AuthToken");
if (username==null) {
        username = (String) session.getAttribute("UserName");
}
Principal user = request.getUserPrincipal();
log.debug("UserPrincipal " + user);
if (username==null && user!=null) {
        username = user.getName();
        password = "";
}

Being as I am new to this project, the reason for that may be obvious but, 
why is an empty value being assigned to the password variable in there?

Thank you. Best regards. 

-- 

Jose Manuel Arnesto López - R&D Innovation

TELVENT
Telvent Arce Sistemas, S.A.
Telvent - Bilbao - Vizcaya
Phone: +34944224004 (2004)  Fax: +34944440658
jm.arnesto@telvent.com
P Eco-Tip: Printing e-mails is usually a waste. 

Re: Trying to make juddi console work with XMLDocAuthenticator

Posted by Kurt T Stam <ku...@gmail.com>.
Hi Jose,

Thank you for the kind words. Much appreciated.

I'm working on the console right now and I will add a fix to the trunk, 
based on your suggestion. That way it will work out of the box for tomcat.

Thanks!

--Kurt

On 8/30/11 9:52 AM, jm.arnesto@telvent.com wrote:
>         Hello there:
>
>         First of all, thanks for replying and thank you very much for 
> the terrific work you have done implementing jUDDI. Now, about the 
> issue at hand, that is what I suspected: when someone finds the time 
> to plug a proper SSO solution in there, then it will be done. Until 
> then, my dirty hack will have to do.
>
>         Best regards.
>
> -- 
>
> Jose Manuel Arnesto López - R&D Innovation
>
> TELVENT
> Telvent Arce Sistemas, S.A.
> Telvent - Bilbao - Vizcaya
> Phone: +34944224004 (2004)  Fax: +34944440658
> jm.arnesto@telvent.com
> PEco-Tip: Printing e-mails is usually a waste.
>
>
>
>
> Kurt T Stam
> 29/08/2011 15:04
> Por favor, responda a user
> Para: 	
> user@juddi.apache.org
> cc: 	
> Asunto: 	Re: Trying to make juddi console work with XMLDocAuthenticator
>
>
>
>
> Hi Jose,
>
> These reason this wasn't fully working is that to do it right we need 
> a full fledged SSO solution. Since
> at the moment we are using tomcatSSO your solution is just fine. You 
> should only have to log into
> the portal. The portlet login panel is there for when you want to run 
> outside of a portal.
>
> Cheers,
>
> --Kurt
>
> On 8/18/11 10:05 AM, _jm.arnesto@telvent.com_ 
> <ma...@telvent.com>wrote:
>         Well, I have made a small hack in the get(String, String) 
> method of class SecurityServiceImpl and it works fine now.
>
>        Before:
> *
>        if* (username== *null* && user!= *null* ) {
>                username = user.getName();
>                password = "" ;
>        }
>
>        After:
>
> *if* ((username== *null* ) && (user!= *null* )) {
>                username = user.getName();
>
>                User tomcatUser = (User) user;   // Tomcat specific. Ouch!
>                password = tomcatUser.getPassword();
>        }
>
>        It is not portable, I don't like it, but it works. All in all, 
> I wonder what the original developers had in mind to solve this issue 
> in a more elegant way.
>
>        Kind regards.
>
>        PS: for some reason, even though I can access the contents of 
> the registry now, the LoginPanel is not shown. Maybe it was not meant 
> to be.
>
> -- 
>
> Jose Manuel Arnesto López - R&D Innovation
>
> TELVENT
> Telvent Arce Sistemas, S.A.
> Telvent - Bilbao - Vizcaya
> Phone: +34944224004 (2004)  Fax: +34944440658 _
> __jm.arnesto@telvent.com_ <ma...@telvent.com>
> P Eco-Tip: Printing e-mails is usually a waste.
>
>
>
>
> jm.arnesto
> 18/08/2011 12:39
> Por favor, responda a user
> Para: 	_
> __user@juddi.apache.org_ <ma...@juddi.apache.org>
> cc: 	
> Asunto: 	Re: Trying to make juddi console work with XMLDocAuthenticator
>
>
>
>
>
>        Hello again:
>
>       I have carried out a small test. I have changed the 
> onModuleLoad() method of UDDIBrowser, making the LoginPanel visible 
> from the beginning:
>
> *public* *void* onModuleLoad() {
> /singleton/ = *this* ;
>                loginPanel = *new* LoginPanel( *this* );
>                loginPanel .setVisible( *true* );
>
>       Then I have removed the initial invocation tot getToken in the 
> LoginPanel constructor:
>
> *public* LoginPanel(Login application) {
> *super* ();
> *this* . application = application;
>
>                //getToken(null, null);
>
>        Besides, the login() method in UDDIBrowser has also been 
> modified to always make the LoginPanel visible, just in case:
>
> *public* *void* login() {
>               String token = loginPanel .getToken();
> *if* (token == *null* ) {
>                        loginPanel .setVisible( *true* );
>               } *else* {
>                        loginPanel .setVisible( *true* );
>
>       The result of all of that is that the LoginPanel is shown within 
> the UDDIBrowser portlet in the console and if I enter the username and 
> password there, the contents of the registry are correctly shown.
>
>       However, I guess the point is to be able to use the login 
> information that is typed when entering pluto to authenticate against 
> jUDDI, without having to enter the username and password in every 
> portlet. If that is the case, I guess the code in SecurityServiceImpl 
> is just not finished. Could anyone comment if that is actually the 
> case (being new to the project, I am just guessing).
>
>       Kind regards.
>
> -- 
>
> Jose Manuel Arnesto López - R&D Innovation
>
> TELVENT
> Telvent Arce Sistemas, S.A.
> Telvent - Bilbao - Vizcaya
> Phone: +34944224004 (2004)  Fax: +34944440658 _
> __jm.arnesto@telvent.com_ <ma...@telvent.com>
> P Eco-Tip: Printing e-mails is usually a waste.
>
>
>
>
> jm.arnesto
> 18/08/2011 12:21
> Por favor, responda a user
> Para: 	_
> __user@juddi.apache.org_ <ma...@juddi.apache.org>
> cc: 	
> Asunto: 	Re: Trying to make juddi console work with XMLDocAuthenticator
>
>
>
>
>
>
>       Well, now I know why both user and password are null. Let's have 
> a look at, for instance, class UDDIBrowser 
> (org.apache.juddi.portlets.client). When that module loads, it creates 
> a new LoginPanel (org.apache.juddi.portlets.client): *
>
>      public* *void* onModuleLoad() {
> /singleton/ = *this* ;
>              loginPanel = *new* LoginPanel( *this* );
>              loginPanel .setVisible( *false* );
>
>      And it is the constructor of LoginPanel that invocates its own 
> getToken(user, password) method with both parameters as null:
>
> *public* LoginPanel(Login application) {
> *super* ();
> *this* . application = application;
>              getToken( *null* , *null* );
>              [...]
>
>      Let's remember that the getToken(user, password) method is as 
> follows:
>
> *protected* *void* getToken(String user, String password) {
>              securityService .get(user, password, *new* 
> AsyncCallback<SecurityResponse>()
>              {
> *public* *void* onFailure(Throwable caught) {
>                              Window./alert/( "Error: " + 
> caught.getMessage());
>                      }
> *public* *void* onSuccess(SecurityResponse response) {
> *if* (response.isSuccess()) {
>                                      token = response.getResponse();
>                                      publisherId = 
> response.getUsername();
>                                      application .login();
>                              } *else* {
>                                      Window./alert/( "error: " + 
> response.getMessage());
>                              }
>                      }
>              });
>      }
>
>      So on first invocation, the parameters sent to 
> SecurityServiceImpl (org.apache.juddi.portlets.server.service) are 
> always to be null. And that causes what I commented at the beginning 
> of the thread (a token cannot be obtained). If that token was 
> sucessfull obtained, the LoginPanel itself would be made visible in 
> the login() method of UDDIBrowser:
>
> *public* *void* login() {
>              String token = loginPanel .getToken();
> *if* (token == *null* ) {
>                      loginPanel .setVisible( *true* );
>              } *else* {
>                      loginPanel .setVisible( *true* );
>                      applicationPanel .setVisible( *true* );
>                      applicationPanel .findAllBusiness();
>              }
>      }
>
>      And after that, you could specify a username and password with 
> that LoginPanel, as can be observed in its onclick(Widget sender) method:
>
> *public* *void* onClick(Widget sender) {
> *if* (sender == tokenButton ) {
>                      getToken( usernameBox .getText(), passwordBox 
> .getText());
>              } *else* {
>                      System. /err/ .println( "undefined" );
>              }
>      }
>
>      And in that case, the username and password that are, at the end, 
> sent to SecutiryServiceImpl, would not be null.
>
>      So, going back to where we started, it seems that on first 
> invocation the username and password sent to method get(String, 
> String) of SecurityServiceImpl are expected to be null and the 
> credentials that are going to be sent to jUDDI itself should be gotten 
> from the login information that was sent to Tomcat on the Pluto login 
> page. Indeed, the username used there is obtained, bot not its password:
>
> *public* SecurityResponse get(String username, String password) {
>              HttpServletRequest request = getThreadLocalRequest();
>              HttpSession session = request.getSession();
>              [..]
>              Principal user = request.getUserPrincipal();
>              [..] *
>              if* ((username== *null* ) && (user!= *null* )) {
>                      username = user.getName();
>                      password = "" ;
>              }
>              [..]
>              AuthToken authToken = login(username, password, 
> session.getServletContext());
>              [..]
>
>      All in all, is that a case of some functionality that is simply 
> not implemented in the console (out of the box supporting some other 
> authentication than JUDDIAuthenticator)?
>
>      Kind regards.
> -- 
>
> Jose Manuel Arnesto López - R&D Innovation
>
> TELVENT
> Telvent Arce Sistemas, S.A.
> Telvent - Bilbao - Vizcaya
> Phone: +34944224004 (2004)  Fax: +34944440658 _
> __jm.arnesto@telvent.com_ <ma...@telvent.com>
> P Eco-Tip: Printing e-mails is usually a waste.
>
>
>
>
> jm.arnesto
> 18/08/2011 10:39
> Por favor, responda a user
> Para: 	_
> __user@juddi.apache.org_ <ma...@juddi.apache.org>
> cc: 	
> Asunto: 	Re: Trying to make juddi console work with XMLDocAuthenticator
>
>
>
>
>
>
>
>      Hello:
>
>     That is a very good question, and that is exactly what I have been 
> trying to find out as of late. It seems SecurityServiceImpl 
> (org.apache.juddi.portlets.server.service) is being called from 
> LoginPanel (org.apache.juddi.portlets.client). It wasn't easy to find 
> it out, given that I had no idea about GWT. Anyway, this is the method 
> in question:
>
> *protected* *void* getToken(String user, String password) {
>
>              securityService .get(user, password, *new* 
> AsyncCallback<SecurityResponse>()
>             {
> *public* *void* onFailure(Throwable caught) {
>                             Window./alert/( "Error: " + 
> caught.getMessage());
>                     }
>
> *public* *void* onSuccess(SecurityResponse response) {
> *if* (response.isSuccess()) {
>                                      token = response.getResponse();
>                                      publisherId = 
> response.getUsername();
>                                      application .login();
>                             } *else* {
>                                     Window./alert/( "error: " + 
> response.getMessage());
>                             }
>                     }
>             });
>     }
>
>      I have added a Window.alert at the beginning of that method and 
> the parameters it is receiving are both null (user and password). I 
> will keep working on this.
>
>     Kind regards.
> -- 
>
> Jose Manuel Arnesto López - R&D Innovation
>
> TELVENT
> Telvent Arce Sistemas, S.A.
> Telvent - Bilbao - Vizcaya
> Phone: +34944224004 (2004)  Fax: +34944440658 _
> __jm.arnesto@telvent.com_ <ma...@telvent.com>
> P Eco-Tip: Printing e-mails is usually a waste.
>
>
>
>
> Tom Cunningham
> 17/08/2011 18:12
> Por favor, responda a user
> Para: 	_
> __user@juddi.apache.org_ <ma...@juddi.apache.org>
> cc: 	
> Asunto: 	Re: Trying to make juddi console work with XMLDocAuthenticator
>
>
>
>
>
>
>
>
> On 08/16/2011 09:26 AM, _jm.arnesto@telvent.com _ 
> <ma...@telvent.com>wrote:
>
> log.debug("UserPrincipal " + user);
> if (username==null && user!=null) {
>    username = user.getName();
>    password = "";
> }
>
> Being as I am new to this project, the reason for that may be obvious 
> but, why is an empty value being assigned to the password variable in 
> there?
>
>
> Hi Jose,
>
> I'm probably missing something really basic here, but why is username 
> null?
>
> --Tom
>


Re: Trying to make juddi console work with XMLDocAuthenticator

Posted by jm...@telvent.com.
        Hello there:

        First of all, thanks for replying and thank you very much for the 
terrific work you have done implementing jUDDI. Now, about the issue at 
hand, that is what I suspected: when someone finds the time to plug a 
proper SSO solution in there, then it will be done. Until then, my dirty 
hack will have to do.

        Best regards.
 
-- 

Jose Manuel Arnesto López - R&D Innovation

TELVENT
Telvent Arce Sistemas, S.A.
Telvent - Bilbao - Vizcaya
Phone: +34944224004 (2004)  Fax: +34944440658
jm.arnesto@telvent.com
P Eco-Tip: Printing e-mails is usually a waste. 



 
Kurt T Stam
29/08/2011 15:04
Por favor, responda a user

Para: 

user@juddi.apache.org
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator


Hi Jose,

These reason this wasn't fully working is that to do it right we need a 
full fledged SSO solution. Since
at the moment we are using tomcatSSO your solution is just fine. You 
should only have to log into
the portal. The portlet login panel is there for when you want to run 
outside of a portal.

Cheers,

--Kurt

On 8/18/11 10:05 AM, jm.arnesto@telvent.com wrote: 
        Well, I have made a small hack in the get(String, String) method 
of class SecurityServiceImpl and it works fine now. 
 
        Before: 

        if (username== null && user!= null ) { 
                username = user.getName(); 
                password = "" ; 
        } 

        After: 

        if ((username== null ) && (user!= null )) { 
                username = user.getName(); 

                User tomcatUser = (User) user;   // Tomcat specific. Ouch! 

                password = tomcatUser.getPassword(); 
        } 

        It is not portable, I don't like it, but it works. All in all, I 
wonder what the original developers had in mind to solve this issue in a 
more elegant way. 

        Kind regards. 

        PS: for some reason, even though I can access the contents of the 
registry now, the LoginPanel is not shown. Maybe it was not meant to be. 

-- 

Jose Manuel Arnesto López - R&D Innovation 

TELVENT 
Telvent Arce Sistemas, S.A. 
Telvent - Bilbao - Vizcaya 
Phone: +34944224004 (2004)  Fax: +34944440658 
jm.arnesto@telvent.com 
P Eco-Tip: Printing e-mails is usually a waste. 



 
jm.arnesto 
18/08/2011 12:39 
Por favor, responda a user 
Para: 

user@juddi.apache.org 
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator 



        Hello again: 

       I have carried out a small test. I have changed the onModuleLoad() 
method of UDDIBrowser, making the LoginPanel visible from the beginning: 

        public void onModuleLoad() { 
                singleton = this ; 
                loginPanel = new LoginPanel( this ); 
                loginPanel .setVisible( true ); 

       Then I have removed the initial invocation tot getToken in the 
LoginPanel constructor: 

        public LoginPanel(Login application) { 
                super (); 
                this . application = application; 

                //getToken(null, null); 

        Besides, the login() method in UDDIBrowser has also been modified 
to always make the LoginPanel visible, just in case: 

        public void login() { 
               String token = loginPanel .getToken(); 
                if (token == null ) { 
                        loginPanel .setVisible( true ); 
               } else { 
                        loginPanel .setVisible( true ); 
 
       The result of all of that is that the LoginPanel is shown within 
the UDDIBrowser portlet in the console and if I enter the username and 
password there, the contents of the registry are correctly shown. 

       However, I guess the point is to be able to use the login 
information that is typed when entering pluto to authenticate against 
jUDDI, without having to enter the username and password in every portlet. 
If that is the case, I guess the code in SecurityServiceImpl is just not 
finished. Could anyone comment if that is actually the case (being new to 
the project, I am just guessing). 

       Kind regards. 

-- 

Jose Manuel Arnesto López - R&D Innovation 

TELVENT 
Telvent Arce Sistemas, S.A. 
Telvent - Bilbao - Vizcaya 
Phone: +34944224004 (2004)  Fax: +34944440658 
jm.arnesto@telvent.com 
P Eco-Tip: Printing e-mails is usually a waste. 



 
jm.arnesto 
18/08/2011 12:21 
Por favor, responda a user 
Para: 

user@juddi.apache.org 
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator 




       Well, now I know why both user and password are null. Let's have a 
look at, for instance, class UDDIBrowser 
(org.apache.juddi.portlets.client). When that module loads, it creates a 
new LoginPanel (org.apache.juddi.portlets.client): 

      public void onModuleLoad() { 
              singleton = this ; 
              loginPanel = new LoginPanel( this ); 
              loginPanel .setVisible( false ); 

      And it is the constructor of LoginPanel that invocates its own 
getToken(user, password) method with both parameters as null: 

      public LoginPanel(Login application) { 
              super (); 
              this . application = application; 
              getToken( null , null ); 
              [...] 

      Let's remember that the getToken(user, password) method is as 
follows: 

      protected void getToken(String user, String password) { 
              securityService .get(user, password, new 
AsyncCallback<SecurityResponse>() 
              { 
                      public void onFailure(Throwable caught) { 
                              Window.alert( "Error: " + 
caught.getMessage()); 
                      } 
                      public void onSuccess(SecurityResponse response) { 
                              if (response.isSuccess()) { 
                                      token = response.getResponse(); 
                                      publisherId = 
response.getUsername(); 
                                      application .login(); 
                              } else { 
                                      Window.alert( "error: " + 
response.getMessage()); 
                              } 
                      } 
              }); 
      } 

      So on first invocation, the parameters sent to SecurityServiceImpl 
(org.apache.juddi.portlets.server.service) are always to be null. And that 
causes what I commented at the beginning of the thread (a token cannot be 
obtained). If that token was sucessfull obtained, the LoginPanel itself 
would be made visible in the login() method of UDDIBrowser: 

      public void login() { 
              String token = loginPanel .getToken(); 
              if (token == null ) { 
                      loginPanel .setVisible( true ); 
              } else { 
                      loginPanel .setVisible( true ); 
                      applicationPanel .setVisible( true ); 
                      applicationPanel .findAllBusiness(); 
              } 
      } 

      And after that, you could specify a username and password with that 
LoginPanel, as can be observed in its onclick(Widget sender) method: 

      public void onClick(Widget sender) { 
              if (sender == tokenButton ) { 
                      getToken( usernameBox .getText(), passwordBox 
.getText()); 
              } else { 
                      System. err .println( "undefined" ); 
              } 
      } 

      And in that case, the username and password that are, at the end, 
sent to SecutiryServiceImpl, would not be null. 

      So, going back to where we started, it seems that on first 
invocation the username and password sent to method get(String, String) of 
SecurityServiceImpl are expected to be null and the credentials that are 
going to be sent to jUDDI itself should be gotten from the login 
information that was sent to Tomcat on the Pluto login page. Indeed, the 
username used there is obtained, bot not its password: 

      public SecurityResponse get(String username, String password) { 
              HttpServletRequest request = getThreadLocalRequest(); 
              HttpSession session = request.getSession(); 
              [..] 
              Principal user = request.getUserPrincipal(); 
              [..] 
              if ((username== null ) && (user!= null )) { 
                      username = user.getName(); 
                      password = "" ; 
              } 
              [..] 
              AuthToken authToken = login(username, password, 
session.getServletContext()); 
              [..] 

      All in all, is that a case of some functionality that is simply not 
implemented in the console (out of the box supporting some other 
authentication than JUDDIAuthenticator)? 

      Kind regards. 
-- 

Jose Manuel Arnesto López - R&D Innovation 

TELVENT 
Telvent Arce Sistemas, S.A. 
Telvent - Bilbao - Vizcaya 
Phone: +34944224004 (2004)  Fax: +34944440658 
jm.arnesto@telvent.com 
P Eco-Tip: Printing e-mails is usually a waste. 




jm.arnesto 
18/08/2011 10:39 
Por favor, responda a user 
Para: 

user@juddi.apache.org 
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator 





      Hello: 

     That is a very good question, and that is exactly what I have been 
trying to find out as of late. It seems SecurityServiceImpl 
(org.apache.juddi.portlets.server.service) is being called from LoginPanel 
(org.apache.juddi.portlets.client). It wasn't easy to find it out, given 
that I had no idea about GWT. Anyway, this is the method in question: 

      protected void getToken(String user, String password) { 

              securityService .get(user, password, new 
AsyncCallback<SecurityResponse>() 
             { 
                      public void onFailure(Throwable caught) { 
                             Window.alert( "Error: " + 
caught.getMessage()); 
                     } 

                      public void onSuccess(SecurityResponse response) { 
                              if (response.isSuccess()) { 
                                      token = response.getResponse(); 
                                      publisherId = 
response.getUsername(); 
                                      application .login(); 
                             } else { 
                                     Window.alert( "error: " + 
response.getMessage()); 
                             } 
                     } 
             }); 
     } 

      I have added a Window.alert at the beginning of that method and the 
parameters it is receiving are both null (user and password). I will keep 
working on this. 

     Kind regards. 
-- 

Jose Manuel Arnesto López - R&D Innovation 

TELVENT 
Telvent Arce Sistemas, S.A. 
Telvent - Bilbao - Vizcaya 
Phone: +34944224004 (2004)  Fax: +34944440658 
jm.arnesto@telvent.com 
P Eco-Tip: Printing e-mails is usually a waste. 




Tom Cunningham 
17/08/2011 18:12 
Por favor, responda a user 
Para: 

user@juddi.apache.org 
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator 






On 08/16/2011 09:26 AM, jm.arnesto@telvent.com wrote: 

log.debug("UserPrincipal " + user); 
if (username==null && user!=null) { 
    username = user.getName(); 
    password = ""; 
} 

Being as I am new to this project, the reason for that may be obvious but, 
why is an empty value being assigned to the password variable in there? 


Hi Jose,

I'm probably missing something really basic here, but why is username 
null?

--Tom 


Re: Trying to make juddi console work with XMLDocAuthenticator

Posted by Kurt T Stam <ku...@gmail.com>.
Hi Jose,

These reason this wasn't fully working is that to do it right we need a 
full fledged SSO solution. Since
at the moment we are using tomcatSSO your solution is just fine. You 
should only have to log into
the portal. The portlet login panel is there for when you want to run 
outside of a portal.

Cheers,

--Kurt

On 8/18/11 10:05 AM, jm.arnesto@telvent.com wrote:
>         Well, I have made a small hack in the get(String, String) 
> method of class SecurityServiceImpl and it works fine now.
>
>         Before:
>
> *        if* (username== *null* && user!= *null* ) {
>                 username = user.getName();
>                 password = "" ;
>         }
>
>         After:
>
> *if* ((username== *null* ) && (user!= *null* )) {
>                 username = user.getName();
>
>                 User tomcatUser = (User) user;   // Tomcat specific. 
> Ouch!
>                 password = tomcatUser.getPassword();
>         }
>
>         It is not portable, I don't like it, but it works. All in all, 
> I wonder what the original developers had in mind to solve this issue 
> in a more elegant way.
>
>         Kind regards.
>
>         PS: for some reason, even though I can access the contents of 
> the registry now, the LoginPanel is not shown. Maybe it was not meant 
> to be.
>
> -- 
>
> Jose Manuel Arnesto López - R&D Innovation
>
> TELVENT
> Telvent Arce Sistemas, S.A.
> Telvent - Bilbao - Vizcaya
> Phone: +34944224004 (2004)  Fax: +34944440658
> jm.arnesto@telvent.com
> P Eco-Tip: Printing e-mails is usually a waste.
>
>
>
>
> jm.arnesto
> 18/08/2011 12:39
> Por favor, responda a user
> Para: 	
> user@juddi.apache.org
> cc: 	
> Asunto: 	Re: Trying to make juddi console work with XMLDocAuthenticator
>
>
>
>
>         Hello again:
>
>        I have carried out a small test. I have changed the 
> onModuleLoad() method of UDDIBrowser, making the LoginPanel visible 
> from the beginning:
>
> *public* *void* onModuleLoad() {
> /singleton/ = *this* ;
>                 loginPanel = *new* LoginPanel( *this* );
>                 loginPanel .setVisible( *true* );
>
>        Then I have removed the initial invocation tot getToken in the 
> LoginPanel constructor:
>
> *public* LoginPanel(Login application) {
> *super* ();
> *this* . application = application;
>
>                 //getToken(null, null);
>
>         Besides, the login() method in UDDIBrowser has also been 
> modified to always make the LoginPanel visible, just in case:
>
> *public* *void* login() {
>                String token = loginPanel .getToken();
> *if* (token == *null* ) {
>                         loginPanel .setVisible( *true* );
>                } *else* {
>                         loginPanel .setVisible( *true* );
>
>        The result of all of that is that the LoginPanel is shown 
> within the UDDIBrowser portlet in the console and if I enter the 
> username and password there, the contents of the registry are 
> correctly shown.
>
>        However, I guess the point is to be able to use the login 
> information that is typed when entering pluto to authenticate against 
> jUDDI, without having to enter the username and password in every 
> portlet. If that is the case, I guess the code in SecurityServiceImpl 
> is just not finished. Could anyone comment if that is actually the 
> case (being new to the project, I am just guessing).
>
>        Kind regards.
>
> -- 
>
> Jose Manuel Arnesto López - R&D Innovation
>
> TELVENT
> Telvent Arce Sistemas, S.A.
> Telvent - Bilbao - Vizcaya
> Phone: +34944224004 (2004)  Fax: +34944440658
> jm.arnesto@telvent.com
> P Eco-Tip: Printing e-mails is usually a waste.
>
>
>
>
> jm.arnesto
> 18/08/2011 12:21
> Por favor, responda a user
> Para: 	
> user@juddi.apache.org
> cc: 	
> Asunto: 	Re: Trying to make juddi console work with XMLDocAuthenticator
>
>
>
>
>
>        Well, now I know why both user and password are null. Let's 
> have a look at, for instance, class UDDIBrowser 
> (org.apache.juddi.portlets.client). When that module loads, it creates 
> a new LoginPanel (org.apache.juddi.portlets.client): *
>
>       public* *void* onModuleLoad() {
> /singleton/ = *this* ;
>               loginPanel = *new* LoginPanel( *this* );
>               loginPanel .setVisible( *false* );
>
>       And it is the constructor of LoginPanel that invocates its own 
> getToken(user, password) method with both parameters as null:
>
> *public* LoginPanel(Login application) {
> *super* ();
> *this* . application = application;
>               getToken( *null* , *null* );
>               [...]
>
>       Let's remember that the getToken(user, password) method is as 
> follows:
>
> *protected* *void* getToken(String user, String password) {
>               securityService .get(user, password, *new* 
> AsyncCallback<SecurityResponse>()
>               {
> *public* *void* onFailure(Throwable caught) {
>                               Window./alert/( "Error: " + 
> caught.getMessage());
>                       }
> *public* *void* onSuccess(SecurityResponse response) {
> *if* (response.isSuccess()) {
>                                       token = response.getResponse();
>                                       publisherId = 
> response.getUsername();
>                                       application .login();
>                               } *else* {
>                                       Window./alert/( "error: " + 
> response.getMessage());
>                               }
>                       }
>               });
>       }
>
>       So on first invocation, the parameters sent to 
> SecurityServiceImpl (org.apache.juddi.portlets.server.service) are 
> always to be null. And that causes what I commented at the beginning 
> of the thread (a token cannot be obtained). If that token was 
> sucessfull obtained, the LoginPanel itself would be made visible in 
> the login() method of UDDIBrowser:
>
> *public* *void* login() {
>               String token = loginPanel .getToken();
> *if* (token == *null* ) {
>                       loginPanel .setVisible( *true* );
>               } *else* {
>                       loginPanel .setVisible( *true* );
>                       applicationPanel .setVisible( *true* );
>                       applicationPanel .findAllBusiness();
>               }
>       }
>
>       And after that, you could specify a username and password with 
> that LoginPanel, as can be observed in its onclick(Widget sender) method:
>
> *public* *void* onClick(Widget sender) {
> *if* (sender == tokenButton ) {
>                       getToken( usernameBox .getText(), passwordBox 
> .getText());
>               } *else* {
>                       System. /err/ .println( "undefined" );
>               }
>       }
>
>       And in that case, the username and password that are, at the 
> end, sent to SecutiryServiceImpl, would not be null.
>
>       So, going back to where we started, it seems that on first 
> invocation the username and password sent to method get(String, 
> String) of SecurityServiceImpl are expected to be null and the 
> credentials that are going to be sent to jUDDI itself should be gotten 
> from the login information that was sent to Tomcat on the Pluto login 
> page. Indeed, the username used there is obtained, bot not its password:
>
> *public* SecurityResponse get(String username, String password) {
>               HttpServletRequest request = getThreadLocalRequest();
>               HttpSession session = request.getSession();
>               [..]
>               Principal user = request.getUserPrincipal();
>               [..] *
>               if* ((username== *null* ) && (user!= *null* )) {
>                       username = user.getName();
>                       password = "" ;
>               }
>               [..]
>               AuthToken authToken = login(username, password, 
> session.getServletContext());
>               [..]
>
>       All in all, is that a case of some functionality that is simply 
> not implemented in the console (out of the box supporting some other 
> authentication than JUDDIAuthenticator)?
>
>       Kind regards.
> -- 
>
> Jose Manuel Arnesto López - R&D Innovation
>
> TELVENT
> Telvent Arce Sistemas, S.A.
> Telvent - Bilbao - Vizcaya
> Phone: +34944224004 (2004)  Fax: +34944440658
> jm.arnesto@telvent.com
> P Eco-Tip: Printing e-mails is usually a waste.
>
>
>
>
> jm.arnesto
> 18/08/2011 10:39
> Por favor, responda a user
> Para: 	
> user@juddi.apache.org
> cc: 	
> Asunto: 	Re: Trying to make juddi console work with XMLDocAuthenticator
>
>
>
>
>
>
>       Hello:
>
>      That is a very good question, and that is exactly what I have 
> been trying to find out as of late. It seems SecurityServiceImpl 
> (org.apache.juddi.portlets.server.service) is being called from 
> LoginPanel (org.apache.juddi.portlets.client). It wasn't easy to find 
> it out, given that I had no idea about GWT. Anyway, this is the method 
> in question:
>
> *protected* *void* getToken(String user, String password) {
>
>               securityService .get(user, password, *new* 
> AsyncCallback<SecurityResponse>()
>              {
> *public* *void* onFailure(Throwable caught) {
>                              Window./alert/( "Error: " + 
> caught.getMessage());
>                      }
>
> *public* *void* onSuccess(SecurityResponse response) {
> *if* (response.isSuccess()) {
>                                       token = response.getResponse();
>                                       publisherId = 
> response.getUsername();
>                                       application .login();
>                              } *else* {
>                                      Window./alert/( "error: " + 
> response.getMessage());
>                              }
>                      }
>              });
>      }
>
>       I have added a Window.alert at the beginning of that method and 
> the parameters it is receiving are both null (user and password). I 
> will keep working on this.
>
>      Kind regards.
> -- 
>
> Jose Manuel Arnesto López - R&D Innovation
>
> TELVENT
> Telvent Arce Sistemas, S.A.
> Telvent - Bilbao - Vizcaya
> Phone: +34944224004 (2004)  Fax: +34944440658
> jm.arnesto@telvent.com
> P Eco-Tip: Printing e-mails is usually a waste.
>
>
>
>
> Tom Cunningham
> 17/08/2011 18:12
> Por favor, responda a user
> Para: 	
> user@juddi.apache.org
> cc: 	
> Asunto: 	Re: Trying to make juddi console work with XMLDocAuthenticator
>
>
>
>
>
>
>
> On 08/16/2011 09:26 AM, jm.arnesto@telvent.com 
> <ma...@telvent.com> wrote:
>
> log.debug("UserPrincipal " + user);
> if (username==null && user!=null) {
>     username = user.getName();
>     password = "";
> }
>
> Being as I am new to this project, the reason for that may be obvious 
> but, why is an empty value being assigned to the password variable in 
> there?
>
>
> Hi Jose,
>
> I'm probably missing something really basic here, but why is username 
> null?
>
> --Tom


Re: Trying to make juddi console work with XMLDocAuthenticator

Posted by jm...@telvent.com.
        Well, I have made a small hack in the get(String, String) method 
of class SecurityServiceImpl and it works fine now. 
 
        Before:

        if (username==null && user!=null) {
                username = user.getName();
                password = "";
        } 

        After:

        if ((username==null) && (user!=null)) {
                username = user.getName();

                User tomcatUser = (User) user;   // Tomcat specific. Ouch!
                password = tomcatUser.getPassword();
        }

        It is not portable, I don't like it, but it works. All in all, I 
wonder what the original developers had in mind to solve this issue in a 
more elegant way.

        Kind regards.

        PS: for some reason, even though I can access the contents of the 
registry now, the LoginPanel is not shown. Maybe it was not meant to be.

-- 

Jose Manuel Arnesto López - R&D Innovation

TELVENT
Telvent Arce Sistemas, S.A.
Telvent - Bilbao - Vizcaya
Phone: +34944224004 (2004)  Fax: +34944440658
jm.arnesto@telvent.com
P Eco-Tip: Printing e-mails is usually a waste. 



 
jm.arnesto
18/08/2011 12:39
Por favor, responda a user

Para: 

user@juddi.apache.org
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator


        Hello again: 

        I have carried out a small test. I have changed the onModuleLoad() 
method of UDDIBrowser, making the LoginPanel visible from the beginning: 

        public void onModuleLoad() { 
                singleton = this; 
                loginPanel = new LoginPanel(this); 
                loginPanel.setVisible(true); 

        Then I have removed the initial invocation tot getToken in the 
LoginPanel constructor: 

        public LoginPanel(Login application) { 
                super(); 
                this.application = application; 

                //getToken(null, null); 

        Besides, the login() method in UDDIBrowser has also been modified 
to always make the LoginPanel visible, just in case: 

        public void login() { 
                String token = loginPanel.getToken(); 
                if (token == null ) { 
                        loginPanel.setVisible(true); 
                } else { 
                        loginPanel.setVisible(true); 
  
        The result of all of that is that the LoginPanel is shown within 
the UDDIBrowser portlet in the console and if I enter the username and 
password there, the contents of the registry are correctly shown. 

        However, I guess the point is to be able to use the login 
information that is typed when entering pluto to authenticate against 
jUDDI, without having to enter the username and password in every portlet. 
If that is the case, I guess the code in SecurityServiceImpl is just not 
finished. Could anyone comment if that is actually the case (being new to 
the project, I am just guessing). 

        Kind regards. 

-- 

Jose Manuel Arnesto López - R&D Innovation 

TELVENT 
Telvent Arce Sistemas, S.A. 
Telvent - Bilbao - Vizcaya 
Phone: +34944224004 (2004)  Fax: +34944440658 
jm.arnesto@telvent.com 
P Eco-Tip: Printing e-mails is usually a waste.   



  
jm.arnesto 
18/08/2011 12:21 
Por favor, responda a user 
Para: 

user@juddi.apache.org 
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator



        Well, now I know why both user and password are null. Let's have a 
look at, for instance, class UDDIBrowser 
(org.apache.juddi.portlets.client). When that module loads, it creates a 
new LoginPanel (org.apache.juddi.portlets.client): 

       public void onModuleLoad() { 
               singleton = this; 
               loginPanel = new LoginPanel(this); 
               loginPanel.setVisible(false); 
 
       And it is the constructor of LoginPanel that invocates its own 
getToken(user, password) method with both parameters as null: 

       public LoginPanel(Login application) { 
               super(); 
               this.application = application; 
               getToken(null, null);         
               [...]         

       Let's remember that the getToken(user, password) method is as 
follows: 

       protected void getToken(String user, String password) { 
               securityService.get(user, password, new 
AsyncCallback<SecurityResponse>() 
               { 
                       public void onFailure(Throwable caught) { 
                               Window.alert("Error: " + 
caught.getMessage()); 
                       } 
                       public void onSuccess(SecurityResponse response) { 
                               if (response.isSuccess()) { 
                                       token = response.getResponse(); 
                                       publisherId = 
response.getUsername(); 
                                       application.login(); 
                               } else { 
                                       Window.alert("error: " + 
response.getMessage()); 
                               } 
                       } 
               }); 
       } 

       So on first invocation, the parameters sent to SecurityServiceImpl 
(org.apache.juddi.portlets.server.service) are always to be null. And that 
causes what I commented at the beginning of the thread (a token cannot be 
obtained). If that token was sucessfull obtained, the LoginPanel itself 
would be made visible in the login() method of UDDIBrowser: 

       public void login() { 
               String token = loginPanel.getToken(); 
               if (token == null ) { 
                       loginPanel.setVisible(true); 
               } else { 
                       loginPanel.setVisible(true); 
                       applicationPanel.setVisible(true); 
                       applicationPanel.findAllBusiness(); 
               } 
       } 

       And after that, you could specify a username and password with that 
LoginPanel, as can be observed in its onclick(Widget sender) method: 

       public void onClick(Widget sender) { 
               if (sender == tokenButton) { 
                       getToken(usernameBox.getText(), passwordBox
.getText()); 
               } else { 
                       System.err.println("undefined"); 
               } 
       } 

       And in that case, the username and password that are, at the end, 
sent to SecutiryServiceImpl, would not be null. 

       So, going back to where we started, it seems that on first 
invocation the username and password sent to method get(String, String) of 
SecurityServiceImpl are expected to be null and the credentials that are 
going to be sent to jUDDI itself should be gotten from the login 
information that was sent to Tomcat on the Pluto login page. Indeed, the 
username used there is obtained, bot not its password: 

       public SecurityResponse get(String username, String password) { 
               HttpServletRequest request = getThreadLocalRequest(); 
               HttpSession session = request.getSession(); 
               [..] 
               Principal user = request.getUserPrincipal(); 
               [..] 
               if ((username==null) && (user!=null)) { 
                       username = user.getName(); 
                       password = ""; 
               } 
               [..] 
               AuthToken authToken = login(username, password, 
session.getServletContext()); 
               [..] 

       All in all, is that a case of some functionality that is simply not 
implemented in the console (out of the box supporting some other 
authentication than JUDDIAuthenticator)? 

       Kind regards. 
-- 

Jose Manuel Arnesto López - R&D Innovation 

TELVENT 
Telvent Arce Sistemas, S.A. 
Telvent - Bilbao - Vizcaya 
Phone: +34944224004 (2004)  Fax: +34944440658 
jm.arnesto@telvent.com 
P Eco-Tip: Printing e-mails is usually a waste.   



 
jm.arnesto 
18/08/2011 10:39 
Por favor, responda a user 
Para: 

user@juddi.apache.org 
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator




       Hello: 

      That is a very good question, and that is exactly what I have been 
trying to find out as of late. It seems SecurityServiceImpl 
(org.apache.juddi.portlets.server.service) is being called from LoginPanel 
(org.apache.juddi.portlets.client). It wasn't easy to find it out, given 
that I had no idea about GWT. Anyway, this is the method in question: 

      protected void getToken(String user, String password) { 

              securityService.get(user, password, new 
AsyncCallback<SecurityResponse>() 
              { 
                      public void onFailure(Throwable caught) { 
                              Window.alert("Error: " + 
caught.getMessage()); 
                      } 

                      public void onSuccess(SecurityResponse response) { 
                              if (response.isSuccess()) { 
                                      token = response.getResponse(); 
                                      publisherId = 
response.getUsername(); 
                                      application.login(); 
                              } else { 
                                      Window.alert("error: " + 
response.getMessage()); 
                              } 
                      } 
              }); 
      } 

       I have added a Window.alert at the beginning of that method and the 
parameters it is receiving are both null (user and password). I will keep 
working on this. 

      Kind regards. 
-- 

Jose Manuel Arnesto López - R&D Innovation 

TELVENT 
Telvent Arce Sistemas, S.A. 
Telvent - Bilbao - Vizcaya 
Phone: +34944224004 (2004)  Fax: +34944440658 
jm.arnesto@telvent.com 
P Eco-Tip: Printing e-mails is usually a waste.   




Tom Cunningham 
17/08/2011 18:12 
Por favor, responda a user 
Para: 

user@juddi.apache.org 
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator





On 08/16/2011 09:26 AM, jm.arnesto@telvent.com wrote: 

log.debug("UserPrincipal " + user); 
if (username==null && user!=null) { 
     username = user.getName(); 
     password = ""; 
} 

Being as I am new to this project, the reason for that may be obvious but, 
why is an empty value being assigned to the password variable in there? 


Hi Jose,

I'm probably missing something really basic here, but why is username 
null?

--Tom 

Re: Trying to make juddi console work with XMLDocAuthenticator

Posted by jm...@telvent.com.
        Hello again:

        I have carried out a small test. I have changed the onModuleLoad() 
method of UDDIBrowser, making the LoginPanel visible from the beginning:

        public void onModuleLoad() {
                singleton = this;
                loginPanel = new LoginPanel(this);
                loginPanel.setVisible(true);

        Then I have removed the initial invocation tot getToken in the 
LoginPanel constructor:

        public LoginPanel(Login application) {
                super();
                this.application = application;

                //getToken(null, null);

        Besides, the login() method in UDDIBrowser has also been modified 
to always make the LoginPanel visible, just in case:

        public void login() {
                String token = loginPanel.getToken();
                if (token == null ) {
                        loginPanel.setVisible(true);
                } else {
                        loginPanel.setVisible(true);
 
        The result of all of that is that the LoginPanel is shown within 
the UDDIBrowser portlet in the console and if I enter the username and 
password there, the contents of the registry are correctly shown. 

        However, I guess the point is to be able to use the login 
information that is typed when entering pluto to authenticate against 
jUDDI, without having to enter the username and password in every portlet. 
If that is the case, I guess the code in SecurityServiceImpl is just not 
finished. Could anyone comment if that is actually the case (being new to 
the project, I am just guessing).

        Kind regards.

-- 

Jose Manuel Arnesto López - R&D Innovation

TELVENT
Telvent Arce Sistemas, S.A.
Telvent - Bilbao - Vizcaya
Phone: +34944224004 (2004)  Fax: +34944440658
jm.arnesto@telvent.com
P Eco-Tip: Printing e-mails is usually a waste. 



 
jm.arnesto
18/08/2011 12:21
Por favor, responda a user

Para: 

user@juddi.apache.org
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator


        Well, now I know why both user and password are null. Let's have a 
look at, for instance, class UDDIBrowser 
(org.apache.juddi.portlets.client). When that module loads, it creates a 
new LoginPanel (org.apache.juddi.portlets.client): 

        public void onModuleLoad() { 
                singleton = this; 
                loginPanel = new LoginPanel(this); 
                loginPanel.setVisible(false); 
  
        And it is the constructor of LoginPanel that invocates its own 
getToken(user, password) method with both parameters as null: 

        public LoginPanel(Login application) { 
                super(); 
                this.application = application; 
                getToken(null, null);         
                [...]         

        Let's remember that the getToken(user, password) method is as 
follows: 

        protected void getToken(String user, String password) { 
                securityService.get(user, password, new 
AsyncCallback<SecurityResponse>() 
                { 
                        public void onFailure(Throwable caught) { 
                                Window.alert("Error: " + 
caught.getMessage()); 
                        } 
                        public void onSuccess(SecurityResponse response) { 

                                if (response.isSuccess()) { 
                                        token = response.getResponse(); 
                                        publisherId = 
response.getUsername(); 
                                        application.login(); 
                                } else { 
                                        Window.alert("error: " + 
response.getMessage()); 
                                } 
                        } 
                }); 
        } 

        So on first invocation, the parameters sent to SecurityServiceImpl 
(org.apache.juddi.portlets.server.service) are always to be null. And that 
causes what I commented at the beginning of the thread (a token cannot be 
obtained). If that token was sucessfull obtained, the LoginPanel itself 
would be made visible in the login() method of UDDIBrowser: 

        public void login() { 
                String token = loginPanel.getToken(); 
                if (token == null ) { 
                        loginPanel.setVisible(true); 
                } else { 
                        loginPanel.setVisible(true); 
                        applicationPanel.setVisible(true); 
                        applicationPanel.findAllBusiness(); 
                } 
        } 

        And after that, you could specify a username and password with 
that LoginPanel, as can be observed in its onclick(Widget sender) method: 

        public void onClick(Widget sender) { 
                if (sender == tokenButton) { 
                        getToken(usernameBox.getText(), passwordBox
.getText()); 
                } else { 
                        System.err.println("undefined"); 
                } 
        } 

        And in that case, the username and password that are, at the end, 
sent to SecutiryServiceImpl, would not be null. 

        So, going back to where we started, it seems that on first 
invocation the username and password sent to method get(String, String) of 
SecurityServiceImpl are expected to be null and the credentials that are 
going to be sent to jUDDI itself should be gotten from the login 
information that was sent to Tomcat on the Pluto login page. Indeed, the 
username used there is obtained, bot not its password: 

        public SecurityResponse get(String username, String password) { 
                HttpServletRequest request = getThreadLocalRequest(); 
                HttpSession session = request.getSession(); 
                [..] 
                Principal user = request.getUserPrincipal(); 
                [..] 
                if ((username==null) && (user!=null)) { 
                        username = user.getName(); 
                        password = ""; 
                } 
                [..] 
                AuthToken authToken = login(username, password, 
session.getServletContext()); 
                [..] 

        All in all, is that a case of some functionality that is simply 
not implemented in the console (out of the box supporting some other 
authentication than JUDDIAuthenticator)? 

        Kind regards. 
-- 

Jose Manuel Arnesto López - R&D Innovation 

TELVENT 
Telvent Arce Sistemas, S.A. 
Telvent - Bilbao - Vizcaya 
Phone: +34944224004 (2004)  Fax: +34944440658 
jm.arnesto@telvent.com 
P Eco-Tip: Printing e-mails is usually a waste.   



  
jm.arnesto 
18/08/2011 10:39 
Por favor, responda a user 
Para: 

user@juddi.apache.org 
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator



        Hello: 

       That is a very good question, and that is exactly what I have been 
trying to find out as of late. It seems SecurityServiceImpl 
(org.apache.juddi.portlets.server.service) is being called from LoginPanel 
(org.apache.juddi.portlets.client). It wasn't easy to find it out, given 
that I had no idea about GWT. Anyway, this is the method in question: 

       protected void getToken(String user, String password) { 

               securityService.get(user, password, new 
AsyncCallback<SecurityResponse>() 
               { 
                       public void onFailure(Throwable caught) { 
                               Window.alert("Error: " + 
caught.getMessage()); 
                       } 

                       public void onSuccess(SecurityResponse response) { 
                               if (response.isSuccess()) { 
                                       token = response.getResponse(); 
                                       publisherId = 
response.getUsername(); 
                                       application.login(); 
                               } else { 
                                       Window.alert("error: " + 
response.getMessage()); 
                               } 
                       } 
               }); 
       } 

        I have added a Window.alert at the beginning of that method and 
the parameters it is receiving are both null (user and password). I will 
keep working on this. 

       Kind regards. 
-- 

Jose Manuel Arnesto López - R&D Innovation 

TELVENT 
Telvent Arce Sistemas, S.A. 
Telvent - Bilbao - Vizcaya 
Phone: +34944224004 (2004)  Fax: +34944440658 
jm.arnesto@telvent.com 
P Eco-Tip: Printing e-mails is usually a waste.   



 
Tom Cunningham 
17/08/2011 18:12 
Por favor, responda a user 
Para: 

user@juddi.apache.org 
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator




On 08/16/2011 09:26 AM, jm.arnesto@telvent.com wrote: 

log.debug("UserPrincipal " + user); 
if (username==null && user!=null) { 
      username = user.getName(); 
      password = ""; 
} 

Being as I am new to this project, the reason for that may be obvious but, 
why is an empty value being assigned to the password variable in there? 


Hi Jose,

I'm probably missing something really basic here, but why is username 
null?

--Tom 

Re: Trying to make juddi console work with XMLDocAuthenticator

Posted by jm...@telvent.com.
        Well, now I know why both user and password are null. Let's have a 
look at, for instance, class UDDIBrowser (org.apache.juddi.portlets.client
). When that module loads, it creates a new LoginPanel (
org.apache.juddi.portlets.client):

        public void onModuleLoad() {
                singleton = this;
                loginPanel = new LoginPanel(this);
                loginPanel.setVisible(false);
 
        And it is the constructor of LoginPanel that invocates its own 
getToken(user, password) method with both parameters as null:

        public LoginPanel(Login application) {
                super();
                this.application = application;
                getToken(null, null); 
                [...] 

        Let's remember that the getToken(user, password) method is as 
follows:

        protected void getToken(String user, String password) {
                securityService.get(user, password, new 
AsyncCallback<SecurityResponse>()
                {
                        public void onFailure(Throwable caught) {
                                Window.alert("Error: " + 
caught.getMessage());
                        }
                        public void onSuccess(SecurityResponse response) {
                                if (response.isSuccess()) {
                                        token = response.getResponse();
                                        publisherId = 
response.getUsername();
                                        application.login();
                                } else {
                                        Window.alert("error: " + 
response.getMessage());
                                }
                        }
                });
        }

        So on first invocation, the parameters sent to SecurityServiceImpl 
(org.apache.juddi.portlets.server.service) are always to be null. And that 
causes what I commented at the beginning of the thread (a token cannot be 
obtained). If that token was sucessfull obtained, the LoginPanel itself 
would be made visible in the login() method of UDDIBrowser:

        public void login() {
                String token = loginPanel.getToken();
                if (token == null ) {
                        loginPanel.setVisible(true);
                } else {
                        loginPanel.setVisible(true);
                        applicationPanel.setVisible(true);
                        applicationPanel.findAllBusiness();
                }
        }

        And after that, you could specify a username and password with 
that LoginPanel, as can be observed in its onclick(Widget sender) method:

        public void onClick(Widget sender) {
                if (sender == tokenButton) {
                        getToken(usernameBox.getText(), passwordBox
.getText());
                } else {
                        System.err.println("undefined");
                }
        }

        And in that case, the username and password that are, at the end, 
sent to SecutiryServiceImpl, would not be null.

        So, going back to where we started, it seems that on first 
invocation the username and password sent to method get(String, String) of 
SecurityServiceImpl are expected to be null and the credentials that are 
going to be sent to jUDDI itself should be gotten from the login 
information that was sent to Tomcat on the Pluto login page. Indeed, the 
username used there is obtained, bot not its password:

        public SecurityResponse get(String username, String password) {
                HttpServletRequest request = getThreadLocalRequest();
                HttpSession session = request.getSession();
                [..]
                Principal user = request.getUserPrincipal();
                [..]
                if ((username==null) && (user!=null)) {
                        username = user.getName();
                        password = "";
                }
                [..]
                AuthToken authToken = login(username, password, 
session.getServletContext());
                [..]

        All in all, is that a case of some functionality that is simply 
not implemented in the console (out of the box supporting some other 
authentication than JUDDIAuthenticator)? 

        Kind regards.
-- 

Jose Manuel Arnesto López - R&D Innovation

TELVENT
Telvent Arce Sistemas, S.A.
Telvent - Bilbao - Vizcaya
Phone: +34944224004 (2004)  Fax: +34944440658
jm.arnesto@telvent.com
P Eco-Tip: Printing e-mails is usually a waste. 



 
jm.arnesto
18/08/2011 10:39
Por favor, responda a user

Para: 

user@juddi.apache.org
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator


        Hello: 

        That is a very good question, and that is exactly what I have been 
trying to find out as of late. It seems SecurityServiceImpl 
(org.apache.juddi.portlets.server.service) is being called from LoginPanel 
(org.apache.juddi.portlets.client). It wasn't easy to find it out, given 
that I had no idea about GWT. Anyway, this is the method in question: 

        protected void getToken(String user, String password) { 

                securityService.get(user, password, new 
AsyncCallback<SecurityResponse>() 
                { 
                        public void onFailure(Throwable caught) { 
                                Window.alert("Error: " + 
caught.getMessage()); 
                        } 

                        public void onSuccess(SecurityResponse response) { 

                                if (response.isSuccess()) { 
                                        token = response.getResponse(); 
                                        publisherId = 
response.getUsername(); 
                                        application.login(); 
                                } else { 
                                        Window.alert("error: " + 
response.getMessage()); 
                                } 
                        } 
                }); 
        } 

         I have added a Window.alert at the beginning of that method and 
the parameters it is receiving are both null (user and password). I will 
keep working on this. 

        Kind regards. 
-- 

Jose Manuel Arnesto López - R&D Innovation 

TELVENT 
Telvent Arce Sistemas, S.A. 
Telvent - Bilbao - Vizcaya 
Phone: +34944224004 (2004)  Fax: +34944440658 
jm.arnesto@telvent.com 
P Eco-Tip: Printing e-mails is usually a waste.   



  
Tom Cunningham 
17/08/2011 18:12 
Por favor, responda a user 
Para: 

user@juddi.apache.org 
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator



On 08/16/2011 09:26 AM, jm.arnesto@telvent.com wrote: 

log.debug("UserPrincipal " + user); 
if (username==null && user!=null) { 
       username = user.getName(); 
       password = ""; 
} 

Being as I am new to this project, the reason for that may be obvious but, 
why is an empty value being assigned to the password variable in there? 


Hi Jose,

I'm probably missing something really basic here, but why is username 
null?

--Tom 

Re: Trying to make juddi console work with XMLDocAuthenticator

Posted by jm...@telvent.com.
        Hello: 

        That is a very good question, and that is exactly what I have been 
trying to find out as of late. It seems SecurityServiceImpl (
org.apache.juddi.portlets.server.service) is being called from LoginPanel 
(org.apache.juddi.portlets.client). It wasn't easy to find it out, given 
that I had no idea about GWT. Anyway, this is the method in question:

        protected void getToken(String user, String password) {

                securityService.get(user, password, new 
AsyncCallback<SecurityResponse>()
                {
                        public void onFailure(Throwable caught) {
                                Window.alert("Error: " + 
caught.getMessage());
                        }

                        public void onSuccess(SecurityResponse response) {
                                if (response.isSuccess()) {
                                        token = response.getResponse();
                                        publisherId = 
response.getUsername();
                                        application.login();
                                } else {
                                        Window.alert("error: " + 
response.getMessage());
                                }
                        }
                });
        }

        I have added a Window.alert at the beginning of that method and 
the parameters it is receiving are both null (user and password). I will 
keep working on this.

        Kind regards.
-- 

Jose Manuel Arnesto López - R&D Innovation

TELVENT
Telvent Arce Sistemas, S.A.
Telvent - Bilbao - Vizcaya
Phone: +34944224004 (2004)  Fax: +34944440658
jm.arnesto@telvent.com
P Eco-Tip: Printing e-mails is usually a waste. 



 
Tom Cunningham
17/08/2011 18:12
Por favor, responda a user

Para: 

user@juddi.apache.org
cc: 

Asunto: 
Re: Trying to make juddi console work with XMLDocAuthenticator


On 08/16/2011 09:26 AM, jm.arnesto@telvent.com wrote: 

log.debug("UserPrincipal " + user); 
if (username==null && user!=null) { 
        username = user.getName(); 
        password = ""; 
} 

Being as I am new to this project, the reason for that may be obvious but, 
why is an empty value being assigned to the password variable in there? 


Hi Jose,

I'm probably missing something really basic here, but why is username 
null?

--Tom

Re: Trying to make juddi console work with XMLDocAuthenticator

Posted by Tom Cunningham <tc...@redhat.com>.
On 08/16/2011 09:26 AM, jm.arnesto@telvent.com wrote:
>
> log.debug("UserPrincipal "+ user);
> if(username==null&& user!=null) {
>         username = user.getName();
>         password = "";
> }
>
> Being as I am new to this project, the reason for that may be obvious 
> but, why is an empty value being assigned to the password variable in 
> there?


Hi Jose,

I'm probably missing something really basic here, but why is username null?

--Tom