hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filiz Gökçe <sonsuzlu...@gmail.com>
Subject Re: WebServis authentication problem, Android
Date Wed, 01 Dec 2010 12:59:46 GMT
I try the username and password on thw webaite, it works correct and I
reseach lots of documents I set the creditandals

SchemeRegistry schemeRegistry = new SchemeRegistry();

            // http scheme
            schemeRegistry.register(new Scheme("http",
PlainSocketFactory.getSocketFactory(), 80));
            // https scheme
            schemeRegistry.register(new Scheme("https", new
EasySSLSocketFactory(), 443));

            params = new BasicHttpParams();
            params.setParameter(ConnManagerPNames.MAX_TOTAL_CONNECTIONS, 1);
            params.setParameter(ConnManagerPNames.MAX_CONNECTIONS_PER_ROUTE,
new ConnPerRouteBean(1));
            params.setParameter(HttpProtocolParams.USE_EXPECT_CONTINUE,
false);
            HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
            HttpProtocolParams.setContentCharset(params, "utf8");

            // ignore that the ssl cert is self signed
            CredentialsProvider credentialsProvider = new
BasicCredentialsProvider();
            credentialsProvider.setCredentials(new AuthScope("
www.yemeksepeti.com", AuthScope.ANY_PORT),
                    new UsernamePasswordCredentials("cs_basari",
"bas0102ari"));
            clientConnectionManager = new
ThreadSafeClientConnManager(params, schemeRegistry);

            context = new BasicHttpContext();
            context.setAttribute("http.auth.credentials-provider",
credentialsProvider);

            DefaultHttpClient client = new
DefaultHttpClient(clientConnectionManager, params);
            HttpGet get = new HttpGet(fedURL);
            HttpResponse response = client.execute(get, context);
like that
Filiz Gökçe




On 1 December 2010 14:50, Oleg Kalnichevski <olegk@apache.org> wrote:

> On Wed, 2010-12-01 at 14:42 +0200, Filiz Gökçe wrote:
> > Hi,
> > the ntlm problem from the services provider. They fix the problem but now
> I
> > take this massage and never connect :
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
> > http://www.w3.org/TR/html4/strict.dtd">
> > <HTML><HEAD><TITLE>You are not authorized to view this page</TITLE>
> > <META HTTP-EQUIV="Content-Type" Content="text/html;
> charset=Windows-1252">
> > <STYLE type="text/css">
> >   BODY { font: 8pt/12pt verdana }
> >   H1 { font: 13pt/15pt verdana }
> >   H2 { font: 8pt/12pt verdana }
> >   A:link { color: red }
> >   A:visited { color: maroon }
> > </STYLE>
> > </HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>
> >
> > <h1>You are not authorized to view this page</h1>
> > You do not have permission to view this directory or page using the
> > credentials that you supplied because your Web browser is sending a
> > WWW-Authenticate header field that the Web server is not configured to
> > accept.
> > <hr>
> > <p>Please try the following:</p>
> > <ul>
> > <li>Contact the Web site administrator if you believe you should be able
> to
> > view this directory or page.</li>
> > <li>Click the <a href="javascript:location.reload()">Refresh</a>
button
> to
> > try again with different credentials.</li>
> > </ul>
> > <h2>HTTP Error 401.2 - Unauthorized: Access is denied due to server
> > configuration.<br>Internet Information Services (IIS)</h2>
> > <hr>
> > <p>Technical Information (for support personnel)</p>
> > <ul>
> > <li>Go to <a href="http://go.microsoft.com/fwlink/?linkid=8180
> ">Microsoft
> > Product Support Services</a> and perform a title search for the words
> > <b>HTTP</b> and <b>401</b>.</li>
> > <li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr),
> >  and search for topics titled <b>About Security</b>,
> <b>Authentication</b>,
> > and <b>About Custom Error Messages</b>.</li>
> > </ul>
> >
> > </TD></TR></TABLE></BODY></HTML>
> >
> >
> > Thanks
> > Filiz Gökçe
> >
> >
>
> You are not authorized or your credentials are wrong.
>
> Oleg
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message