Smugmug web service ported to O2 : Host authentication required

Thanh Trung Dinh dinhthanhtrung1996 at gmail.com
Sun Jun 10 10:03:19 BST 2018


Hi Gilles,

So I have finished porting google and smugmug to O2. I have pushed to
gsoc18-exporttools-o2 branch and I'm running statistic check now. For
google photo, I noticed something strange :

   1. I can upload to album created with digiKam but not album created on
   the web (Google Photo).
   2. When importing, images are downloaded but not appear in digiKam view.
   So I guess they are not synchronized with database (?)

Besides, I don't have account created on Picasa Web when it hadn't been
into Google Photo, so all my test are with Google Photo. I don't know if
there are any other bugs with repos like that.

So, could you make some tests on my new codes to verify? I added a TODO
list as you said, so that we can keep track of what I haven't done yet.

Best,
Thanh

On Thu, Jun 7, 2018 at 8:39 PM, Thanh Trung Dinh <
dinhthanhtrung1996 at gmail.com> wrote:

> Hi Gilles,
>
> Currently, I finished main functionalities of those needed to be ported to
> O2 for Smugmug and Google. For Facebook, I think that I have finished all.
> In fact, those new implementations worked with my tests. I still have to do
> the app review on Facebook, so that digiKam can be used out of developer
> mode. Besides, there are many things that I want to change on the interface
> for the next step, the factorization part, so I do thing that beta stage is
> really necessary.
>
> Now, I am finishing codes for Smugmug and Google. I plan to run the static
> analyzers this weekend to check my codes. So, is it possible that
> back-porting my branch to master is on Sunday afternoon, so that I will
> have enough time to accomplish my part? I really want to see user feedbacks
> for new O2 implementations.
>
> Thanh.
>
> On Thu, Jun 7, 2018 at 4:32 PM, Gilles Caulier <caulier.gilles at gmail.com>
> wrote:
>
>> Hi Thanh,
>>
>> We have the second student working on the manual icon-view sorting
>> project who advance well and have completed a first stage of the project as
>> the code is typically read for testing as beta by end users.
>>
>> We plan to release an official 6.0.0-beta1 version in a near future, with
>> a back-port from the student development branch to master.
>>
>> The goal is to provide an official test version with a release
>> announcement including new feature to test, and of course to catch user
>> feedback quickly in goal to stabilize new implementations.
>>
>> What do you think about your project ? Some O2 implementations can be
>> ready for a beta stage ? Of course, this will include to back-port current
>> code from your branch to master.
>>
>> Best
>>
>> Gilles
>>
>> 2018-06-06 0:15 GMT+02:00 Thanh Trung Dinh <dinhthanhtrung1996 at gmail.com>
>> :
>>
>>> Hi,
>>>
>>> I finally figured out why I got this error. I post on forum so that if
>>> anyone working with O2 and smugmug api later won't waste too much time.
>>>
>>> I found out that I had tried to create a request with some parameters,
>>> so I used O1::createRequestParameters to add those parameters to the
>>> request and sign it. However, I forgot to add the request to the url
>>> itself. According to a post I found on Smugmug forum, when a request cannot
>>> be parsed because of something relating to oauth, it will be returned with
>>> error "Authentication required", and that explains why I didn't get this
>>> error when trying to make a normal GET request (without any OAuth1
>>> parameters) to a public endpoint. So, that's it - the root cause of this
>>> problem.
>>>
>>> Thanh.
>>>
>>>
>>>
>>>
>>>
>>> On Sun, Jun 3, 2018 at 9:52 PM, Thanh Trung Dinh <
>>> dinhthanhtrung1996 at gmail.com> wrote:
>>>
>>>> Hi Maik,
>>>>
>>>> In fact, I added those lines and nickName is not always empty. In
>>>> core/tests/webservices/smugmug.cpp
>>>> <https://cgit.kde.org/digikam.git/tree/core/tests/webservices/smugmug.cpp?h=gsoc18-exporttools-o2#n51>,
>>>> I added a command line option for login with nickname. When you run
>>>> standalone test for smugmug with --login <nickname>, the nickname will be
>>>> propagated when the login page is opened, so that I can get the nickName
>>>> from user. In fact, It came from my misunderstanding. At that time, I had
>>>> succeeded with authentication, but when I tried to get current user info
>>>> from endpoint /api/v2!authuser (reference here
>>>> <https://api.smugmug.com/api/v2/doc/reference/user.html>), I got the
>>>> same error of "authentication required" that I mentioned above. I had
>>>> misunderstood that there was problem with that endpoint, so in order to use
>>>> other APIs, I had to have nickname (at least), so I added that command line
>>>> option. However, later I found out that even with nickname, I still got the
>>>> same error when I tried to POST something via APIs. I finally figured out
>>>> that these endpoints (those I succeeded with GET) are public, so no need
>>>> for access token, and the problem still remains with endpoints needing
>>>> token (/api/v2!authuser is one of them). Therefore, it must be problem with
>>>> including auth token to the request.
>>>>
>>>> I attache here a patch with my latest modifications so that you can
>>>> test it.
>>>>
>>>> Thanh.
>>>>
>>>> On Sun, Jun 3, 2018 at 8:13 PM, Maik Qualmann <metzpinguin at gmail.com>
>>>> wrote:
>>>>
>>>>> Hi Thanh,
>>>>>
>>>>> Look smugwindow.cpp: 232 the nickName is always empty. Therefore your
>>>>> login
>>>>> function will never be executed. I think login with nickname does not
>>>>> exist
>>>>> anymore, so the dialog for entering email and password can be removed
>>>>> as well.
>>>>> The LINK to Smugmug then works through the website, but the return
>>>>> Json code
>>>>> has changed.
>>>>>
>>>>> Maik
>>>>>
>>>>> Am Samstag, 2. Juni 2018, 23:49:42 CEST schrieb Thanh Trung Dinh:
>>>>> > Hi everyone,
>>>>> >
>>>>> > I'm porting digiKam web services with library O2, qt library for
>>>>> OAuth.
>>>>> > Working on Smugmug, I'm stuck with an error that I didn't understand.
>>>>> >
>>>>> > Smugmug uses OAuth 1.0 as authentication method, like Flickr, so I
>>>>> used same
>>>>> > methods to login, get user data, post photos, etc. In fact, I can
>>>>> login and
>>>>> > get access token using O2 methods. I also verified that the token I
>>>>> got is
>>>>> > the right one. However, whenever I tried to use that token to
>>>>> get/post
>>>>> > something, QNetworkReply returns with error 204
>>>>> > (AuthenticationRequiredError) and error message : "Host
>>>>> authentication
>>>>> > required". Besides, Smugmug has endpoints that don't require token
>>>>> to access
>>>>> > (e.g GET /api/v2/user/<nickname>). So when I tried normal GET method
>>>>> of
>>>>> > QNetworkManager it worked, but when I used specific method for GET
>>>>> in O2
>>>>> > (which prepares token and other necessary headers in the url
>>>>> request), that
>>>>> > error appeared,
>>>>> >
>>>>> > Did anyone see this message error when working with authentication
>>>>> before? I
>>>>> > really appreciate any help and guide, since I am really stuck here.
>>>>> >
>>>>> > Thanks,
>>>>> >
>>>>> > Thanh-Trung Dinh
>>>>> >
>>>>> >
>>>>> >
>>>>> > --
>>>>> > Sent from: http://digikam.1695700.n4.nabb
>>>>> le.com/digikam-devel-f1695701.html
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Mr. Thanh-Trung Dinh
>>>> Université de Technologie de Compiègne (UTC) - France
>>>> Tel: +33 7 53 68 20 29
>>>>
>>>
>>>
>>>
>>> --
>>> Mr. Thanh-Trung Dinh
>>> Université de Technologie de Compiègne (UTC) - France
>>> Tel: +33 7 53 68 20 29
>>>
>>
>>
>
>
> --
> Mr. Thanh-Trung Dinh
> Université de Technologie de Compiègne (UTC) - France
> Tel: +33 7 53 68 20 29
>



-- 
Mr. Thanh-Trung Dinh
Université de Technologie de Compiègne (UTC) - France
Tel: +33 7 53 68 20 29
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-devel/attachments/20180610/4025f841/attachment.html>


More information about the Digikam-devel mailing list