Qt-Google-OAuth

Sample application to showcase how to use Qt C++ to authenticate Google apps

View the Project on GitHub chilarai/Qt-Google-OAuth

Qt-Google-OAuth

Sample application to showcase how to use Qt C++ to authenticate Google apps. I have referred part of the code from Stackoverflow Question answered by Xplatforms. I will keep the repo updated as Qt and Google introduces more changes.

Feel free to improve the code and post your issues

Files

GoogleOAuth.pro

Remember to add networkauth in the list of Qt module dependencies

QT += networkauth

googleauth.h & googleauth.cpp

Please read the comments in the files. I have tried to explain all the details of the code. Remember to edit the MY_CLIENT_SECRET, MY_CLIENT_ID & port_number (in my case, it is 5476) in googleauth.cpp

this->google->setClientIdentifier("MY_CLIENT_ID");
this->google->setClientIdentifierSharedKey("MY_SECRET_KEY");
auto replyHandler = new QOAuthHttpServerReplyHandler(5476, this);

main.cpp

Initialized the googleauth object

main.qml

Contains the button which calls the grant() method of Qt and prompts Google auth on the browser

Others