Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Oauth 2 and QTCPServer issue

Oauth 2 and QTCPServer issue

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HellFighter
    wrote on last edited by
    #1

    I'm using QT lib https://github.com/pipacs/o2 for authorization using Oauth 2.0. For example i can try to authorize in facebook using example provided in there. If I use GrantFlow AuthorizationCode everything works fine, but if i switch to GrantFlowImplicit authorization fails. After research I found that in void O2ReplyServer::onBytesReady() method when it read data from socket I've got empty query string!
    @GET / HTTP/1.1
    Host: 127.0.0.1:1965
    Connection: keep-alive
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36
    Accept-Encoding: gzip,deflate,sdch
    Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4@
    But when I look in my browser I can clearly see a access_token and so on after #.

    How can I receive data placed after #?

    I'm using Qt 5.4 beta on Mac OS X

    1 Reply Last reply
    0
    • H Offline
      H Offline
      HellFighter
      wrote on last edited by
      #2

      I can describe the problem in the abstract of the library used. When a local QTCPServer handles redirect from the social network with URI like this:
      @http://127.0.0.1:1965/?#access_token=CAADPRS5aPeABAPGqlEILMSdRlNMGBK0wUU38GmWTWrTPwV39j5ToNaOKoTlKVJBs2icOKesdKQOEgYF8JAWcWnZASOs8ZAdyNfpbKRq9VVI7HtFrYBAfyBikpqqk6KjsvZBFcdjxBZAAymGKj0OwTyjtKHRNsgTKcqSLZCnHWt3gGuGZBWWKKFBjeZAfzZBOH9Q91GXLEbpnZCIFU5y1qtIoE&expires_in=5160500@
      (I can see it in my browser), after reading all received data from soket
      @socket->readAll();@

      there is no query string at all:
      @GET / HTTP/1.1
      Host: 127.0.0.1:1965
      Connection: keep-alive
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8
      User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36
      Accept-Encoding: gzip,deflate,sdch
      Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4@
      The question is: why browser shows me /?#access_token=CAA... but QTCPServer shows only / ?

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved