Open login page of QOAuthAuthorizationCodeFlow with QWebEngineView



  • Hi together,

    i'm trying to solve following problem.

    Description:

    I'm using the QOAuthAuthorizationCodeFlow to authenticate against a Service. For that a i have an instance oauth_ of the class QOAuthAuthorizationCodeFlow. Ok, then i'm setting all relevant attributes with member variables like:

    oauth_->set_scope(scope_);
    oauth_->setClientIdentifier(client_identifier_);
    oauth_->setAuthorizationUrl(auth_url_);
    // and so on ...
    

    Then i'm configuring several connects with signals and slots which handle the requests and responses. Everything works fine.
    Now the relevant point. Up to now i used an external browser (firefox) to authenticate against the service. Here the code

    connect(oauth_, &QOAuthAuthorizationCodeFlow::authorizeWithBrowser, &QDesktopServices::opernUrl);
    oauth_->grant();
    

    The grant() function starts the OAuth 2 procedure.

    But i don't want to use the external browser. I have to use the QWebEngineView for authentication. I found this code snippet to open a page:

    QWebEngineView *view_ = new QWebEngineView;
    view_->setUrl(QUrl("https://forum.qt.io"));
    view_->load();
    

    This also works.

    How can i connect the QWebEngineView with my QOAuthAuthorizationCodeFlow ?
    Anyone some ideas ?

    Thanks in advance
    Rjuz


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.