Answer the question
In order to leave comments, you need to log in
Interaction of a desktop application with a web service?
Where can I read about protocols for interaction between desktop applications and web services? In particular, the issue of authentication and authorization is of interest.
The option with OAuth is not of interest, since, as far as I understand, it requires a slightly larger number of gestures from the user, except for how to drive their username and password into the program settings.
For example, the URL that opens the Dropbox website via a link from the context menu contains some kind of authorization parameters. Either this is a session identifier, or some kind of API key. I would like to understand where it comes from, and what is its life cycle.
Or take the Last.fm desktop client - I’m not sure, but it’s unlikely that it sends a login / password for authentication for each request.
Maybe Evernote uses some standard approach? Well, and so on.
Answer the question
In order to leave comments, you need to log in
> For example, the URL that opens the Dropbox website via a link from the context menu contains some kind of authorization parameters.
dropbox'a API here: www.dropbox.com/developers/docs#api-specification
> Or take the Last.fm desktop client - I'm not sure, but it's unlikely that it sends a login / password for authentication for each request.
No, the application sends a request for vatization and receives a session_key in response, which then in each request it must send a
full description of the API here: www.last.fm/api/authspec
Or you can look at a sample of the code here: github.com/Voker57/qmpdclient /blob/master/src/lastfmsubmitter.cpp
In the doHandshake() method, an authorization request is sent, then in the gotNetReply() method we receive and process the response: m_session then send a POST request to the desired URL (in the scrobbleQueued() and scrobbleNp() methods, to the corresponding url — m_subUrl or m_npUrl )
m_session=data[1];
m_npUrl=data[2];
m_subUrl=data[3];
About evernote is on HABR: habrahabr.ru/company/evernote/blog/120895/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question