Re: Authentication



On 08/23/2009 07:14 PM, Pavel Kurta wrote:
> SoupSession* session =
> soup_session_sync_new_with_options(SOUP_SESSION_USER_AGENT, "MyUserAgent");
> SoupMessage *msg = soup_message_new ("GET", "http://test.com";);   
> 
> SoupAuth* sAuth = soup_auth_new(SOUP_TYPE_AUTH_BASIC, msg, "Basic 
> realm=\"Test\"");
> soup_auth_authenticate(sAuth, "aaa", "bbb");
> 
> guint  status = soup_session_send_message (session, msg);
> 
> But I send request without Authentication:

Right. You can't "pre-emptively" authenticate a message. You have to
wait until the "authenticate" signal is emitted by the SoupSession, and
that will include a SoupAuth argument, and you call
soup_auth_authenticate() on that, and libsoup will then re-send the
message for you with authentication. (And all further requests to the
same auth domain will automatically be authenticated for you.)

-- Dan


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]