Re: 401 error



Hello,

I'm not really 100% familiar whit the library, so sorry if I jump in the discussion, but reading the docs and from my experiments I was under the impression that, assuming that the server side implementation is correct, the "right" flow would be to send your SoupMessage WITHOUT concatenating user and password in the url, the server would respond with some form of 401, the "authenticate" signal would be emitted by the library and soup_auth_authenticate () should be called in the signal handler, and to avoid the useless 401 when you are sure the url requires authentication there is soup_auth_manager_use_auth ()

Did you check if the "authenticate" signal is emitted if you don't put user/pass in the url?

Are my assumptions wrong?

Fabio

2015-07-16 16:00 GMT+02:00 Dan Winship <danw gnome org>:
On 07/16/2015 07:14 AM, Sam Bull wrote:
> I've failed to get any response at all from the GNOME shell list, so I'm
> posting this to a couple of other related lists, to see if I can get any
> support. My extension has stopped working in GNOME 3.14+ due to a 401
> error. Can anybody help with this? Details below.
>
> On Sat, 2015-06-20 at 00:45 +0100, Sam Bull wrote:
>> On Sat, 2015-06-13 at 10:54 +0100, Sam Bull wrote:
>>> On Mon, 2015-06-01 at 09:53 +0100, Sam Bull wrote:
>>>> In GNOME Shell 3.14, on Ubuntu 15.04, my extension is no longer able to
>>>> sync to Owncloud due to a 401 error. Is there a change to
>>>> Soup.message.new() that causes it to use cookies or something?

No. If you don't manually add a SoupCookieJar feature to the session, it
won't use cookies.

It's impossible to say for sure what's wrong without seeing more
information. Eg, the rest of the code, or a copy of the HTTP request and
response.

>>         (gnome-shell:1470): libsoup-WARNING **: soup-session.c:887:
>>         invalid property id 18 for "add-feature-by-type" of type
>>         'GParamGType' in 'SoupSession'
>>         (gnome-shell:1470): Gjs-WARNING **: JS ERROR: TypeError:
>>         httpSession.add_feature_by_type is not a function
>>
>> With the code:
>>
>>         const httpSession = new Soup.Session();
>>         httpSession.add_feature_by_type(Soup.TYPE_AUTH_BASIC);

Yeah, that's a known bug in the gjs bindings. You'd have to do:

  Soup.Session.prototype.add_feature_by_type.call(httpSession,
Soup.TYPE_AUTH_BASIC);

But that's not your problem anyway. Basic auth is enabled by default.
However, I mention this because you could instead do:

  logger = Soup.Logger.new(Soup.LoggerLogLevel.BODY, -1);
  Soup.Session.prototype.add_feature.call(httpSession, logger);

and then it will log the HTTP traffic.

(Note: not actually tested, but I think that's the right JS syntax...)

-- Dan

_______________________________________________
libsoup-list mailing list
libsoup-list gnome org
https://mail.gnome.org/mailman/listinfo/libsoup-list



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