Okay
I managed to work out I need to connect  twice

1)  just to get the nonce  from the server and the Realm

2)  to actually connect and send the username and password response

Now  I can get the first page,  but how do I continue to get other  pages ?  or 
do further request ?

This is my second request  that works and gives me the index page

// Prepare to TRULY connect     
if (serverNONCE != null && serverREALM != null) {
        HttpGet                 httpGet    = new 
HttpGet("https://www.mysite.org/index.html";);
        DigestScheme  digestAuth = new DigestScheme();
        digestAuth.processChallenge(hdrs[0]);
        Header auth = digestAuth.authenticate(new 
UsernamePasswordCredentials("username" , "password"), httpGet);
Log.w("-----1" , "Auth is  "+auth.getName()+"      "+auth.getValue());          
                                
        httpGet.setHeader(auth);
        result  = client.execute(httpGet);
        hdrs    = result.getHeaders("Authentication-Info");
}


Now I want to check the result  (which is a HttpResponse)  and see that there 
is a link   "you_got_it"
now I want to request the page  https://www.mysite.org/you_got_it

What do I have to repeat ?  the   digestAuth.authenticate ?? or what ?

Thanks again


On May 8, 2011, at 2:48 PM, Kumar Bibek wrote:

> First check what 401 means. And then try to narrow down the possible causes 
> of the problem. 
> 
> Full working sample code!!!!! Ah!! I don't think anyone has so much time for 
> that.
> 
> Kumar Bibek
> http://techdroid.kbeanie.com
> http://www.kbeanie.com
> 
> 
> 
> On Sun, May 8, 2011 at 11:29 PM, New Developer <[email protected]> wrote:
> I keep finding code snippets
> 
> for use with https  none have worked
> either get a 401 error  or some other error
> 
> Any got or know  a full working tutorial
> that uses  httpS   not  http  and Digest  Authentication
> 
> that shows how to send and receive data from a website  using these two 
> parameters
> https  443  and  Digest Authentication  not Basic
> 
> Please any full code segment,  not snippets that I keep finding with a google 
> search
> 
> 
> Thanks in advance
> 
> 
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to