Getting google access_token

I had problems with the way to access the Google APIs, I was able to connect to Google, which otaining the authorization code.
However, the way Exchange code for the access token and refresh for the tokens that the problem, Google docs, only they provide an example of Javascript, but I dug and here is what I got:

QUrl postUrl = QUrl("https://accounts.google.com/o/oauth2/token");
    QNetworkRequest request(postUrl);
    request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
    QUrl params;
// the auth code has been saved as code to declared QSettings settings
     params.addQueryItem("code=", settings->value("key").value().append(" "));
        params.addQueryItem("client_id=", "");
        params.addQueryItem("client_secret=", " ");
        params.addQueryItem("redirect_uri=", "urn:ietf:wg:oauth:2.0:oob&");
        params.addQueryItem("grant_type=", "authorization_code");

        QNetworkReply* reply = m_networkmanager::post(request, params.encodedQuery());
           bool ok = connect(reply, SIGNAL(finished()), this, SLOT(checkReply()));
           Q_ASSERT(ok);
           Q_UNUSED(ok);

the answer I get is 'Bad Request'.

Please what am I doing wrong?.
How I put it right?.

OAuth2 is complicated and poorly documented. You're doing C++? I have a class C++ OAuth2 library I wrote for my support application that manages Google OAuth by encapsulating the functioinal but clumsy OAuthQt library. All sites don't OAuth2 slightly differently and my library has been designed to be extensible to any variation that I needed in the future. Currently it handles only Google and Bitly, but I intend to develop many popular services and eventually publish under a Creative Commons license. I'm not willing to share the source code, but if you do things in C++ (or could do this way), I'd build you libraries arm and i86 and supply you with the header files you would use.

I am very careful when writing to my class for the Google libraries and Bitly classes both have the syntax of fully functional Builder so you can create and configure the OAuth with a single statement. Because I'm not ready to release this publicly I do have documentation so you should discuss with me to understand.

I must warn you that, even with a powerful helper like mine, OAuth2 class is quite complicated.

Tags: BlackBerry Developers

Similar Questions

  • Somehow my search engine has been changed to yahoo from google, and now I can't get google search to stay as search engine, how can I solve this?

    I don't know how it happened, but can not get google search to stay as my search engine. I use the version the most recent Firefox is here. I deleted all the other search engines, but it always goes back to yahoo. Not like yahoo, I want my back lol, google. Please tell me how to solve this problem, thank you.

    Unwanted modules can take control of your settings in Firefox (search engine, home page, the new tab page) and make it impossible for you to fight them. Here's my method of tracking down and cleaning of the bad modules, the air pirates and injectors ad. I know it seems long, but it's not so bad.

    (1) open the Control Panel, uninstall a program. After the loading of the list, click on the column heading "installed on" to group infections, I mean additions by date. This can help the undisclosed items bundle smoker who snuck out with some software, you have agreed to install. Beware of everything that you don't recognize / remember, since malware often uses sounding names important or innocent to discourage you remove. Out as much garbage as possible here.

    (2) open Firefox page modules using either:

    • CTRL + SHIFT + a
    • "3-bar" menu button (or tools) > Add-ons
    • in the Windows "Run" dialog box, type or paste
      firefox.exe "about:addons"

    In the left column, click on Plugins. Set essential and unrecognized plugins 'never enable '.

    In the left column, click Extensions. Then, in case of doubt, disable (or delete, if possible) not recognized and unwanted extensions. Do not forget that all extensions are optional, none come with Firefox, and you can learn more about them by checking their reviews on the site of the Add - ons.

    Often, a link will appear above at least an extension disabled to restart Firefox. You can complete your work on the tab and click one of the links in the last step.

    Any improvement?

    (3) you can search the rest of problems with scanning/cleaning tools listed in our technical support article: Troubleshooting Firefox problems caused by malware. These scanners on request are free and take a long time to run. If they end quickly, especially if they require the payment you have a serious infection. I suggest the specialty forums listed in the article in this case.

    Success?

  • Thank you for the good program. I'm from Ukraine and you have changed the default Google search engine Yandex, a Russian. How can I get Google?

    I'm from the Ukraine. Firefox is the browser number one for me. I used to Google search in the address bar and now I have to use Russian Yandex. I don't want to use the Russian search engine. I know that there are research tools, but I like to use the address bar. How can I get Google? Thank you

    Hi, vmbr!

    I see if I can help.

  • Why has she changed my default google to yahoo search engine? and how to get google?

    Why has she changed my default google to yahoo search engine? and how to get google?

    It changed when I did the OS x el capitan was updated a few days ago

    A plug-in or add on could have asked or forced into it without your consent.

    Close Safari

    Open Safari, hold down the SHIFT key

    go to Safari > Preferences

    go to the general tab

    change your homepage

    go to the 'Search' TAB

    change your search engine

    for other browsers will refer to their documentation for support

    https://support.Mozilla.org/en-us/KB/reset-preferences-fix-problems

    https://support.Mozilla.org/en-us/KB/reset-preferences-fix-problems

  • How can I get google as my search engine by default on my homepage

    Some how my Firefox has crashed, so I used the mode without fail for about a week. Today (07/02/13), he came in normal mode, but in both modes, the default engine which is google which is normally found in the center of the page above the search box on the web isn't here. I went to manage search engine and nothing was there at the beginning. Somehow I had accidentally Firefox help happen. So today I managed to get google listed. Most of the buttons in the search engines manage does not work. They are not now. I am very frustrated because I tried some of the suggestions but not of them worked for me. I really try to avoid to reinstall because I have a few bookmarks that I don't want to lose them.

    The reset Firefox feature can solve a lot of problems in restaurant Firefox to its factory default condition while saving your vital information.
    Note: This will make you lose all the Extensions, open Web sites and preferences.

    To reset Firefox, perform the following steps:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the button 'Reset Firefox'.
    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    Information can be found in the article Firefox Refresh - reset the settings and Add-ons .

    This solve your problems? Please report to us!

  • I can't get Google maps to work on Firefox.

    I can't get Google maps to work on Firefox. I have a web site with a Google map on this topic, but potential customers using Firefox will not be able to use this function to locate me. Can someone please help me solve this problem?

    The reset Firefox feature can solve a lot of problems in restaurant Firefox to its factory default condition while saving your vital information.
    Note: This will make you lose all the Extensions, open Web sites and preferences.

    To reset Firefox, perform the following steps:

    1. Go to Firefox > help > troubleshooting information.
    2. Click on the button 'Reset Firefox'.
    3. Firefox will close and reset. After Firefox is finished, it will display a window with the imported information. Click Finish.
    4. Firefox opens with all the default settings applied.

    Information can be found in the article Firefox Refresh - reset the settings and Add-ons .

    This solve your problems? Please report to us!

  • How can I get Google to be default when I opened top-a-new-tab? Should what modules I install? Thank you, Alan

    How can I get Google to be default when I opened top-a-new-tab? Should what modules I install? Thank you, Alan

    You are welcome.

  • START CLICK ON MSN, I GET GOOGLE... WHY? don't want to google

    once more... when I sign in I click on MSN. CAN I GET GOOGLE. I DON'T HAVE GOOGLE ACCT.

    I SIGN UP FOR MSN, PLEASE DELETE GOOGLE, I'M NOT. TK U

    See if this helps:

    http://Windows.Microsoft.com/en-us/Windows7/change-your-Internet-Explorer-home-page

  • How to get google hangouts to work on the Surface RT?

    Is it possible to actually get google hangouts to work on the Surface RT? I installed 2 google apps, but two of them are trying to open in the browser explore who told me that the meeting places is not supported on RT. Are there no work around? My whole family that uses and I can't join them in discussions.

    Google has publicly stated that they have no interest in Microsoft platforms.  For the most part, Google think that if you want to use Google products, you need to buy a computer from Google (chromebook, android tablet, android phone, etc.).  It's a very sad state of affairs.

  • How to get Google search?

    Hello

    Lately I have Yahoo when searching. I specify Google under prefs > search engine, but I always get from Yahoo.

    How to return to Google?

    Thank you very much

    Raphael

    Is it in Safari?

    I'm not at my mac at the moment, but I believe you can choose this in the about the address field drop-down list.

  • Since YOU insist ON making us go to GOOGLEPLAY, I'M SCREWED! I can't get Google in CHINA! So I switch to Opera on my machine at home and my Samsung!

    Details? I want TO JUST FireFox on my Samsung Galaxy Tab 3. But I arrives later for synchronization with cuz of FireFox on my computer at home I can ONLY find it on GOOGLEPLAY! And GOOGLE STUPID don't get cuz there my Samsung was purchased here in China, where I live! (Google and China do not like each other) WHY the FRELL is not just Mozilla host their own files themselves?

    The construction of the canal Aurora is suggested because the Firefox installation manual apks on the exit and beta channel receive no updates.

  • How to get google work once again, I tried all of the suggestions I've seen so far!

    The service Google has suddenly stopped working in Firefox. In the box of the home page, of toolbar and to address, when I search I just get a blank screen, no results.

    I uninstalled Firefox and reinstalled from a new download. I checked all add ons and plugins are up-to-date, I did a full system scan to check the malware and nothing seems to work.

    Someone at - it ideas?

    You can check if you have the XML files including Google's default search engines still in the searchplugins folder in the Firefox program folder.

    If this isn't the case, then you need to reinstall Firefox.

    Try to use the extension SearchReset reset preferences to default values.

    Note that the SearchReset extension runs only once and then uninstalls automatically, so it will not appear on the page "> Firefox Add-ons" (topic: addons).

  • When I go on safari I only get google this is my search engine

    I better stay with google or go back to safari on safari at the moment I get just search google.

    I do not understand your question.  Are you willing to change your search engine from Google to something else?  You can do in the Safari preferences by going to the 'Search' tab.  If you are wanting to change the home page of Safari, you would also do in Safari preferences, but in the general tab.

  • Impossible to get Google earth to work; Google Earth has stopped working

    I can't Google earth to work after downloading Google earth, when I try to use it I get a message that Google Earth has stopped working. Is there a way to tell if my graphics card works or if I need a new graphics card?

    As far as I know, these are the requirements for Google Earth - https://support.google.com/earth/answer/20701?hl=en. Make sure that your PC and graphics are satisfied, and that your graphics card drivers are up to date with the latest version of your PC manufacturer supports the web site.

    - Https://support.google.com/earth/answer/176180?hl=en may be useful. Try what he refers to as switching between DirectX and OpenGL to see if that helps etc..

    Is there any (exact) error message and the error code given? There are clues that are recorded in the Event Viewer log? (look in "Local event viewer" - "summary of administrative events' - 'Criticism' or 'Mistakes' for any reference to the time and date of the accident).

  • How to get Google chat.

    Original title: Google chat

    Hello.  Where can I get a download secure for the older version of Google talk and video chat?  The only thing I see now is for meeting places. Thanks Bob

    Google discontinued the old cat and has blocked, meeting places is the only option now.

Maybe you are looking for

  • How to add a Notepad txt file in a tab

    I have a list of words in the notebook, more I copied in C. I would like to be able to open in its own tab to switch back if necessary and there not disappear behind the open page. However, there is more no Web page. I copied it to the origin of a we

  • iPad Pro bettery and charger voltage

    HI, I have an iPad Pro 12 "and on the charger its written 5.2V and 2. 4A. I would like to ask - is it ok to charge my iPad with a 5V 2. 4A charger? It is harmful to the battery in the long term? Appreciate your help.

  • HP_RECOVERY Drive - do not know how to use it

    I have never needed to use the HP_RECOVERY player and currently have PC problems where I might have to use it.  But, I think that my drive HP_RECOVERY is perhaps not current.  Please see below: 1. problem Description: -When I open the HP_RECOVERY (D

  • Safari does not open websites

    Safari opens Google, Facebook & Wiki... But not open many sites... Like all those who come in the google search results... Error:-"Safari can't connect to the server.

  • HP Pavilion DV6-6112sg drivers

    Hello! I have a HP Pavilion DV6-6112sg and I want to update all its drivers, but I'm very bad with it (2 days ago, I tried to update the audio driver, and I had to reinstall the system, because I couldn't get the sound back...) I found this part of t