<div dir="ltr"><div>Hi Maik,</div><div><br></div><div>In fact, I added those lines and nickName is not always empty. In <a href="https://cgit.kde.org/digikam.git/tree/core/tests/webservices/smugmug.cpp?h=gsoc18-exporttools-o2#n51">core/tests/webservices/smugmug.cpp</a>, 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 (<a href="https://api.smugmug.com/api/v2/doc/reference/user.html">reference here</a>), 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.</div><div><br></div><div>I attache here a patch with my latest modifications so that you can test it. <br></div><div><br></div><div>Thanh.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jun 3, 2018 at 8:13 PM, Maik Qualmann <span dir="ltr"><<a href="mailto:metzpinguin@gmail.com" target="_blank">metzpinguin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Thanh,<br>
<br>
Look smugwindow.cpp: 232 the nickName is always empty. Therefore your login <br>
function will never be executed. I think login with nickname does not exist <br>
anymore, so the dialog for entering email and password can be removed as well. <br>
The LINK to Smugmug then works through the website, but the return Json code <br>
has changed.<br>
<span class="HOEnZb"><font color="#888888"><br>
Maik<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
Am Samstag, 2. Juni 2018, 23:49:42 CEST schrieb Thanh Trung Dinh:<br>
> Hi everyone,<br>
> <br>
> I'm porting digiKam web services with library O2, qt library for OAuth.<br>
> Working on Smugmug, I'm stuck with an error that I didn't understand.<br>
> <br>
> Smugmug uses OAuth 1.0 as authentication method, like Flickr, so I used same<br>
> methods to login, get user data, post photos, etc. In fact, I can login and<br>
> get access token using O2 methods. I also verified that the token I got is<br>
> the right one. However, whenever I tried to use that token to get/post<br>
> something, QNetworkReply returns with error 204<br>
> (AuthenticationRequiredError) and error message : "Host authentication<br>
> required". Besides, Smugmug has endpoints that don't require token to access<br>
> (e.g GET /api/v2/user/<nickname>). So when I tried normal GET method of<br>
> QNetworkManager it worked, but when I used specific method for GET in O2<br>
> (which prepares token and other necessary headers in the url request), that<br>
> error appeared,<br>
> <br>
> Did anyone see this message error when working with authentication before? I<br>
> really appreciate any help and guide, since I am really stuck here.<br>
> <br>
> Thanks,<br>
> <br>
> Thanh-Trung Dinh<br>
> <br>
> <br>
> <br>
> --<br>
> Sent from: <a href="http://digikam.1695700.n4.nabble.com/digikam-devel-f1695701.html" rel="noreferrer" target="_blank">http://digikam.1695700.n4.<wbr>nabble.com/digikam-devel-<wbr>f1695701.html</a><br>
<br>
<br>
<br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><font size="2" face="comic sans ms, sans-serif">Mr. Thanh-Trung Dinh</font></div></div></div></div></div></div></div></div></div></div></div><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font size="2" face="comic sans ms, sans-serif">Université de Technologie de Compiègne (UTC) - France<br><font color="#000000">Tel:</font><font color="#3d85c6"> </font><font color="#000000">+33 7 53 68 20 29</font></font></div></div></div></div></div></div></div></div></div></div></div>
</div>