Hello,

I'm developing an application that needs to connect to OpenStreetMap API
with Http basic authentication.

I use Hibernate, Spring, Tapestry and maven. When I run the maven tests it
uses the Spring test support and it does the authentication successfully via
HttpClient. The problem is when I call the same use case from Tapestry: I
get the following error from OpenStreetMap:

19-ene-2011 23:26:27
org.apache.commons.httpclient.auth.AuthChallengeProcessor selectAuthScheme
INFO: basic authentication scheme selected
19-ene-2011 23:26:27 org.apache.commons.httpclient.HttpMethodDirector
processWWWAuthChallenge
INFO: Failure authenticating with BASIC 'Web
Password'@api06.dev.openstreetmap.org:80
50446 [1481353080@qtp-730403186-0] ERROR
org.apache.tapestry5.services.TapestryModule.RequestExceptionHandler -
Processing of request failed with uncaught exception:
es.udc.gisapp.model.util.exceptions.ServiceException: HTTP error; status
code = 401
org.apache.tapestry5.runtime.ComponentEventException:
es.udc.gisapp.model.util.exceptions.ServiceException: HTTP error; status
code = 401 [at
classpath:es/udc/gisapp/web/pages/applicationservice/MigrarBdOsm.tml, line
17]

¿How can I make the basic http authentication with tapestry without loosing
anything important?

Thank you in advance

I also attach the code that I use to make the authentication use case:

public HttpMethod prepareMethodForBasicHttpAuthentication(
                        CuentaOsm cuentaOsm, HttpMethod method)
                        throws InstanceNotFoundException {

                String usernamePassword = cuentaOsm.getOsmLoginMail() + ":"
                                + cuentaOsm.getOsmClearPassword();
                String basicAuthorizationString = EncodingUtil
                                .encodeBase64(usernamePassword);

                method.addRequestHeader("Authorization", "Basic "
                                + basicAuthorizationString);

                return method;
        }
-- 
View this message in context: 
http://tapestry.1045711.n5.nabble.com/Http-Basic-authentication-with-Tapestry-tp3348700p3348700.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to